Java Final keyword

Source: Internet
Author: User

Final: Meaning immutable,

Common terms Modify variables, method entry, methods, and classes

1. Modify the variable, indicating that the variable can only be assigned directly or at the time of construction, not accept the second assignment, that is, the reference to the memory address is not allowed to change again;

2. Modification method Entry: Indicates that the entry parameter does not allow the value to be changed during the lifetime, but can change the value of the point to the object;

3. Modification method: Indicates that the method is not allowed to be overridden, the private adornment method of the parent class implicitly adds the final keyword to the default;

4. Modifier class: Indicates that the class cannot be inherited

It is worth mentioning that the final static is used together, indicating that the member occupies a storage space in memory that cannot be changed.

Java Final keyword

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.