Use Java to do the project, but find a lot of Java Foundation is not very clear. (Learn a little bit about it)
Keyword: public protected private default final
Public: All places are available,
Protected: Can be used in the same class, or in the same package, or a different package but is his subclass,
Private: Can only be used in the same class inside (may be internal classes OH),
Default: The same class inside, or within the same package.
The function of the final keyword is to think of a constant that cannot be changed (so it is initialized at the time of definition), but what is not changed is that the value of the underlying type cannot be changed, whereas for a modified object variable it is said that its reference cannot be changed (he can also initialize it in the constructor).
Declare method as final inline mechanism, it will make you call the final method when the method body is inserted directly into the call, Instead of making routine method calls, such as saving breakpoints, pressing stacks, and so on, this may make your program more efficient, but when your method body is very large, or you call this method in many places, then your calling body code will quickly expand, may affect efficiency, so you should use caution with the Span style= "font-family:arial;" >final for method definition.
when you will when final is used on a class, you need to think about it because a final class cannot be inherited by anyone, which means that this class is a leaf class in an inheritance tree, And this type of design has been considered perfect without the need for modification or expansion.
Java Fundamentals: Member variable access control and final keyword