The use of Java final

Modified class: Indicates that this class is the final class and cannot be inherited. 
Modified method: Indicates that the method is final and cannot be overridden. 
Modified variable: Indicates that the variable cannot be assigned again after the first assignment (it can only be assigned once). 
1. Local variables 
2. Member variables 
------Instance member variables 
------Static member variables 
Modifier class:

 Modification method:

 

 Modified local variables:

 

 Modified member variables:

Instance member variables:

 Static member variable:

 

Guess you like

Origin blog.csdn.net/weixin_51757999/article/details/125654599