JAVA final keyword, constant definition, final keyword
Final (final) is a modifier
1. final can be used to modify classes, functions, and variables (member variables, local variables)
2. Classes modified by final cannot be inherited by other classes.
3. Methods (functions) modified by final cannot be overwritten.
4. The variable (attribute) modified by final cannot be assigned another value. final must assign a value when modifying the variable. The variable after final modification is called a constant.
Define constant: final type capital constant name = constant value
Constant naming rules: uppercase letters are required. If the name is composed of multiple words, the words are separated _.
Public class Test {public static void main (String [] args) {final String TITLE = "TITLE"; // defines the constant System of the String type. out. println (TITLE );}}