Differences between Java j2se static and final

Source: Internet
Author: User
Final considerations:
1. abstract and final cannot modify a class at the same time.
2. the modifier ensures that the method cannot be overloaded by the quilt class. The methods that have been modified by private and all the methods included in the final class are considered as fianl by default.
3. If primitive data is modified, the data cannot be changed. If the object is modified, the data cannot be changed. For example, an object contains another object, which can be changed.
The two have different points:
StaticEmphasize only one copy
FinalEmphasis is constant
StaticUnlike final, static is a modifier or a variable is static, while final is a variable defined as a constant.

 

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.