Brief analysis of final finally finalize

Source: Internet
Author: User

1.final

The final modifier class, which indicates that the class cannot be inherited, is a top-level class.

The final modifier variable, which indicates that the variable is constant and cannot be changed after initialization.

The fianl modifier means that this method cannot be overridden, but the final decorated method can be overloaded. (The common final method is the wait (), notify () method in the object class)


2.finally

Finally is the keyword, in exception handling, the try sentence executes the content that needs to be run, the catch sentence is used to catch the exception, and the finally word indicates whether or not an exception occurred, will be executed. Finally dispensable. But Try....catch must appear in pairs.


3.finalize ()

The Finalize () method, the method of the object class, and any class inherit the object class, so any object has this method. This method is called by the GC when it determines that the object is not referenced.

Brief analysis of final finally finalize

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.