1. Scope of use: Class, method, and variable.
2. Differences and contacts:
2.1.static: static. The methods and attributes modified by static only belong to any object that does not belong to the class.
2.2.static usage:
2.2.1.static can be used to modify [internal classes], methods, and member variables.
2.2.2.static [do not modify external classes] and [do not modify local variables] (because static itself is defined as Class-level, so local variables cannot be modified using static ).
2.3 final meaning: [only one value can be assigned.
2.2.final usage:
2.2.1.final indicates that the attribute can only be assigned once. (1) basic type: the value cannot be modified; (2) reference type: the reference type cannot be modified.
2.2.2.final indicates that the method cannot be overwritten, but can be accessed by the quilt class (if the method is not private ).
2.2.2.final indicates that the class cannot be inherited.
3. Joint Use of static final
. Applicability:
3.1.2. the intersection of the two ranges can only be modified: member variables, methods, and internal classes.
. Meaning: it is also the intersection of the two:
3.2.1. Method: Method of the class and cannot be overwritten.
3.2.2. member variable: a variable of the class and can be assigned only once.
3.2.3. Internal class: It belongs to an external class and cannot be inherited