ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Variable
What is variable
? Variable is like a container.
Declare a variable in java
dataType variableName = value;
Example:
int age =25;
Declare a multiple variable in java
Identifier Declaration
? Identifiers must begin with a letter, a $ symbol, or a _ symbol.
? Identifiers can include numbers but not start with them.
? Since Java 9, a single underscore _ is not allowed as an identifier.
? You cannot use the same name as a Java reserved word.
? You can not use white space in variable.
Reversed words
Naming Conventions
? Variable should be camel case.
Example
int ageLimit = 10
Null value
? Assigning null in primitive types is compilation error.

More Related Content

Variable in java