This example describes the final keyword usage in java. Share to everyone for your reference, specific as follows:
Depending on the context, the Java keyword Final also has a subtle distinction, but it usually means "this is immutable." "There are
Depending on the context, there are subtle differences in the Java keyword final, but it usually means "this cannot be changed." "There are two reasons why you don't want to change: one is efficiency, the other is design. Because there are two
Java string optimization
The final keyword in Java can be used in class members (not called domains), in class methods, and in classes.
The final is used in the domain to represent:
1, a constant amount of compilation that never changes.
2, a
Final classwhen a class is defined as final class, it means that the class cannot be inherited by other classes, that is, it cannot be used after extends. Otherwise, errors are obtained during compilation.
Package Com.iderzheng.finalkeyword;
Based on the context. The keywordfinal of Java is slightly different. But it is generally referred to as "This cannot be changed." "The reason does not want to change from two: one is efficiency, and there is a design. There are two reasons for the
Depending on the context, Java's keywordfinal also has subtle differences, but usually refers to "this cannot be changed." "There are two reasons not to change: one is efficiency, and the other is design. Because two reasons are very far apart, the
Depending on the context, Java's keywordfinal also has subtle differences, but usually refers to "this cannot be changed." "There are two reasons not to change: one is efficiency, and the other is design. Because two reasons are very far apart, the
Depending on the context, Java's keywordfinal also has subtle differences, but usually refers to "this cannot be changed." "There are two reasons not to change: one is efficiency, and the other is design. Because two reasons are very far apart, the
Depending on the context, Java's keywordfinal also has subtle differences, but usually refers to "this cannot be changed." "There are two reasons not to change: one is efficiency, and the other is design. Because two reasons are very far apart, the
Depending on the context, Java's keywordfinal also has subtle differences, but usually refers to "this cannot be changed." "There are two reasons not to change: one is efficiency, and the other is design. Because two reasons are very far apart, the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.