<thinking in Java Chapter Fifth > initialization and cleanup

Source: Internet
Author: User

You can use this (ARG) in the p86--constructor to invoke another constructor, but you cannot call two. In addition, the constructor call must be placed at the very beginning, or the compiler will make an error.

About the process of the Finalize method:

When the object becomes (GC roots) Unreachable, the GC determines whether the object overrides the Finalize method, and if it is not overwritten, it is recycled directly. Otherwise, the Finalize method of the object in the queue is executed by a low-priority thread if the object has not performed a Finalize method and puts it into the f-queue queue. After the Finalize method is executed, the GC will determine whether the object is reachable or not, and if not, the object is "resurrected" if it is not reachable.

The Finalize method is unpredictable, often dangerous, and, in short, superfluous.

The following example does not understand why:

<thinking in Java Chapter Fifth > initialization and cleanup

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.