When the garbage collector wants to reclaim objects, you first call the Finalize method of the class (you can write the program to validate the conclusion), and the normal Java-written class does not need to overwrite this method, because object has
the Java Finalize method usestags: JAVAAPPLETOBJECTWIZARDJVM Work2011-08-21 11:37 48403 People read comments (5) favorite reports Classification:Java (+)"JAVA programming ideas":Java provides the finalize() method, which is called Finalize ()
Final keyword:The final keyword usually refers to "immutable", and the use of "cannot be changed" can be done for two reasons: design or efficiency.Final can modify variables, methods, and classes.first, final variablesA domain that is both static
From: http://www.cnblogs.com/lzhdim/archive/2009/11/04/1595845.html
Before learning about finalize and dispose, we need to understand two concepts: managed resources and non-commissioned resources.A. managed resources generally refer to the memory
The last post talked about the optimization of the garbage collector. After a long time, I didn't continue to talk about finalize (in fact, this is a bit of a problem with GC ). Today, let's take a look at the performance topics related to finalize
This is the best article I have read about finalize in Java.
Finalize () in Java ()
When the garbage collector wants to recycle objects, it first needs to call the Finalize method of this class (you can write a program to verify this conclusion).
Finalfinal-modifier (keyword) If a class is declared final, it means that it can no longer derive a new subclass and cannot be inherited as a parent class. Therefore, a class cannot be declared abstract and declared final. Declaring variables or
Final-modifier (keyword) if a class is declared as final, it means that it cannot generate a new subclass and cannot be inherited as a parent class. Therefore, a class cannot be declared both abstract and final. Declare variables or methods as final
Directory
Basic Preparation related knowledge
object's destruction process
An example of an object rebirth
The finalize execution order of the object
When and how to use Finalize
Reference
Basic Preparation related knowledge
1 Java GC is
Function
Understanding Finalize ()-destructor substitution
In many ways, Java is similar to C + +. Java syntax is very similar to C++,java classes, methods, and data members; Java classes have constructors; Java has exception handling.
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.