Final can be modified: attributes, methods, classes, and local variables (variables in methods)
The final modified attributes can be initialized during the compilation or runtime, but cannot be changed after initialization.
The final modifier attributes are related to specific objects. The final attributes initialized at runtime can have different values for different objects.
The final attribute indicates a constant (cannot be modified after creation ).
The final modifier method indicates that the method cannot be overwritten in the subclass, and the final modifier class indicates that the class cannot be inherited.
For basic data types, final changes the value to a constant (cannot be modified after creation), but for object handles (also called references or pointers ), final changes the handle to a constant (the handle must be initialized to a specific object during declaration. In addition, you cannot direct the handle to another object. However, the object itself can be modified. This restriction applies to arrays, arrays also belong to objects, and arrays can also be modified. The final handle in the method parameter means that inside the method, we cannot change the actual thing that the parameter handle points to, that is, the parameter handle cannot be assigned another value within the method ).
Static can be modified: attributes, methods, code segments, internal classes (static internal classes or nested internal classes)
Static modified attributes are initialized during the compilation period (when the class is loaded) and can be changed after initialization.
All objects of the static property have only one value.
Static modified attributes emphasize that there is only one of them.
The attributes, methods, and code segments of the static modifier have nothing to do with the specific objects of the class. If you do not create an object, you can also call static modifier attributes and methods.
Static and "this, super" are not independent. static has nothing to do with specific objects, while this and super are related to specific objects.
Static cannot modify local variables.
There is no difference between static final and final static. Generally, static is written before.
Static modifier attributes emphasize that there is only one of them. final modifier attributes indicate a constant (cannot be modified after creation ). The property modified by static final indicates that once a value is given, it cannot be modified and can be accessed by class name.
Static final can also be used to modify a method, indicating that the method cannot be rewritten and can be called without a new object.