java-final keyword brief __java keyword

Source: Internet
Author: User
Objective

In the usual logical code, we rarely use the final keyword, but in reading some of the source when the final keyword is still very commonly used, the main use of the following several, this article is for personal learning and use, not necessarily correct, but also please see the Bo friends to give the relevant exchange of views Final Cosmetic class

Indicates that the class cannot be inherited, but all member methods in the final class are implicitly specified as the final method. Final Modification Method

The final modified method means that it is locked to prevent the inheriting class from modifying its associated implementation. final modifier variable

The final-modified constants cannot be changed, and the final-decorated variables can not be assigned again, but the object's properties can be changed, just as objects cannot be represented by the = number.

        Final String b = "Hello";
        B= "AAA";  Not allowed
Internal in-depth blog (to understand ...)

Http://www.cnblogs.com/dolphin0520/p/3736238.html

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.