In the program, the study of variables occupies an absolute proportion, because it is changeable, can accomplish many functions, the constant is not the view of the variable as much, but the role of the constant in the program is equally important. The amount of value that does not change during program execution is constant, The concept is relative to a variable. Variables are used to store and record data such as Pi Pi constants in these mathematics.
Constants in Java are divided into two categories, one is a literal constant, and the other is a custom constant. Custom constants are well understood, such as a person's gender is immutable, and we can define it as a constant when we define it. Literal constants are written values, such as "HelloWorld" is a literal constant, called a string constant. Similar to the integer constant: such as 100,200, decimal constant: such as 12.32; character constants: such as ' A ', ' B ', etc. Boolean constants: such as True,false; An empty constant (NULL) represents an empty reference, and the reference does not point to.
Literal constants are often used to assign values to variables, or to make up a class's properties, and are simple to use, so it's easier to learn and is part of a Java program.
Immutable----in the change of constants for the Java language (05)