Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> Which example were you looking at?
Thanks, ps. I am now on excercise 13 (creating a Tank, filling and emptying it, and enforcing a "death condition" by checking in the finalize() method. Here also I am experiencing the problem. I call the gc, but my finalize() method is not being called. However, I added a print line, and it had no effect. What am I missing? Why can't I force finalization, as he says I can? I haven't tried System.runFinalization, which shouldn't make a difference, anyways, according to the book. pps. I just read something that may explain the problem "If System.gc() is called, then finalization happens to all the objects. This was not necessarily the case with previous implementations of the JDK, although the documentation claimed otherwise" I am using Visual Age for Java 3.5. I don't think this should be a problem, but who knows? David
Replies: |
Sponsored Links
|