1.final class
The final class cannot be inherited, there are no subclasses, and the methods in the final class are final by default.
The final class cannot be inherited, so the member methods of the final class have no chance of being overwritten, and the default is final.
2.final method
The final method cannot inherit from the quilt class, but can inherit.
3.final variables
A constant is represented by a final decorated member variable that cannot be changed once a value is given.
When the final variable is defined, it can be declared without giving the initial value, which is also called the final blank, and the compiler will ensure that the blank final must be initialized before it is used, regardless of the situation.
4.final parameters
When the function parameter is the final type, you can read the parameter using it, but you cannot change the value of the parameter.
public class Test {public static void Main (string[] args) { new Test (). F1 (2); } public void F1 (final int i) { i++; I is the final type, and the value is not allowed to change. System.out.print (i); } }
Final local variable I cannot be assigned. It must is blank and not using a compound assignment
2016/09/21 Java Keyword final