[What is the difference between final finally finalized in the question]java?]

Source: Internet
Author: User

Final is a modifier that can be used to modify variables, methods, and classes. When modifying a variable. Represents a variable that cannot be changed, that is, a constant. Constants need to be assigned at the time of definition or assigned by constructors, and they can only be selected; When the method is modified, the method can only be called, cannot be overridden, and when the class is decorated, the class cannot be derived from the subclass. So a class cannot be both final and abstract;


Finally is a try clause in the exception handling mechanism. Used to handle the necessary cleanup work, the fear of running a catch with a return statement finally will also run before the return;


finalized is a method defined in Object. Subclasses generally override this method to do the necessary cleanup before the object is collected by GC, which is typically called by the GC, but when overloaded with finalized, the GC simply invokes the finalized of the initial version number, explicitly invoking the initial version number of the finalized The method has very large uncertainties.

[What is the difference between final finally finalized in the question]java?]

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.