The definition of a constant: the amount of its value does not change (more precisely, it is not changeable) during the course of the program is called a constant.
The function of constants: simple, intuitive description of a thing, is the basis of variables, is the basis of the program run.
Constants are divided into two main categories: primitive values (which do not need to be defined), such as: (1, 2.1) numeric constants, (' A ', ' Chinese ') literal constants, (true, false) logical constants, NULL constants
Class II: Immutable variable (required to be defined for use) For example: public static final int a = 1, the variable must be initialized when defined, and its value cannot be changed in the future
The definition of a variable: the amount of time that the value can change in a program when it is running is called a variable.
The role of variables: In order to store data during program run
A variable contains three parts: A variable type, a variable name, and a variable value. For example, create a variable: int a = 1, (In essence: A storage area is opened in memory, and the name and type defined for that difference can be stored in the process without changing the data of that type)
The scope of the variable: A variable can only be used in its current {}
Constants and variable learning records in Java