Constants and variables in java

The concept of variables:

It occupies a certain storage area in the memory;

The region has its own name (variable name) and type (data type);

The data area may vary continuously within a range of the same type;

 

Why do you want to define variables:

To continue the same type of stored constants, and can be reused;

Note the use of variables:

Scope of variables, initialization values

Define the variable format:

Data type    variable name =  initial value;

Note: The format is fixed, remember format, maintaining the status quo.

Range: defining the start to the end of its defined code blocks;

In the same range, it does not allow multiple local variable naming conflicts

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11130492.html