Variables

Variables are what we use to store values inside of computer programs, after that, we can use this stored information to do some process that uses this value.

Variable Definition

In Java, we start a variable definition by writing the type of the variable followed by a name, equal sign symbol, then, we assign a value, at the end of the line we put a semicolon.

String color = “blue”;

int age = 35;

In the first variable definition above, the variable type is String, the variable name is color, and the variable value is blue.

When we assign a text as a variable value we put it between double-quotes.

In the second variable definition above, the variable type is int, the variable name is age, and the variable value is 35.

I hope, I helped you to learn something!

See you next time!

You can check the code here: https://github.com/Aleangelozi/Java