About override finalize () method of the problem

Category: Java SE
 
mzq20091009
2011-08-23 05:33:52

Sponsored Links
Beginner java, some concepts confusion,
System.gc () is a method of recycling garbage memory, it calls a finalize (),
that we can finalize () in the re-write some of the statements,
Then call System.gc () is executed when these statements,
then finalize () This method was originally inside what ah? It is used to do?
We rewrite is not the time to put it would have been covering up?

Sponsored Links

ZL94100165
2011-08-23 05:41:18
My answer:
cleared by the garbage collector before the object, call the finalize () method to clear all the activities and the release of other types may share resources. Although the garbage collector can reclaim the memory resource, but not completely or effectively close the file and terminate responsible for similar network link such a thing. This is the finalize () purposes.

we want a little help!
adamnb1
2011-08-23 05:46:52
Object class finalize () does not seem to, but only to the definition stated in the method throws an exception.
nieweiping520
2011-08-23 05:49:19
This reply is automatically sent, only for display only, no other special role
landlord [sasami615 2008-07-09 10:36:24] Until the historical summary data (not including post):
Total Posts: 9 posting scores: 310 ; each affixed Average Score: 34
the total number of posts: 6 ; the total number of stickers score: 0 Replies score: 0% ;
Results posted total: 3 ; Results posted a total score: 60 ;
no satisfactory statement posted: 0 ; without a satisfactory statement posted points : 0
Not junction Posts: 6 ; outstanding total score: 250 ;
Results posted Percentage: 33.33% Results of the percentage: 19.35%
no Satisfaction Results posted rate: 0.00% satisfaction knot points rate: 0.00 %
landlord some posts of the knot
allenliuchao
2011-08-23 06:08:33
finally:

finally keyword Java exception handling model is the best supplement. finally allows the code will always be executed, regardless of whether an exception occurs. Using finally can maintain an object's internal state, and can clean up non-memory resources. If you do not finally, your code will be very difficult to understand.

s33371573
2011-08-23 06:22:34
protected void finalize () throws Throwable {}
object source, Upstairs solution
ufotomy307
2011-08-23 06:25:52
finalize () {
which is that you should have to execute the code!
}
sunshining666
2011-08-23 06:44:51
not clear understand ~ ~ look
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.