Home > Back-end >  The JAVA language variables
The JAVA language variables

Time:01-21

1. In the process of program is running, may produce some temporary data at any time, the application will save the data to some memory unit, the memory unit is called variable
2. Variables including variable name type variable value
3. The effect of variable:
Variables can be used to store a data, gave a name to this data (variables) easier for programmers to use the variable
4. Use variables before need to declare that the assignment again,
5. How to declare variables: how to assign a value:
(1) data type variable names;
Example: int a;//declare a variable of type int
(2) data type variables 1, 2, 3, variable name... ;
Example: int a, b, c, d;//declare int variables of type a, b, c, d
(3) to the variable assignment: variable name=value;
(4) the declaration and assignment of variables can be written together:
Data type variable name=value;
Data type variable name=value, variable name=value, variable name=value;
Since I have been (5) the variable declarations can use?
Global variables, local variables out of the local failure
  • Related