Question from Mind Q Mock.
37. Which of the following statements about
Java's garbage collection are true?
a) The garbage collector can be invoked explicitly using a Runtime object.
b) The finalize method is always called before an object is garbage collected.
c) Any class that includes a finalize method should invoke its superclass' finalize method.
d) Garbage collection behavior is very predictable.
Ans is a, b, c.
I don't think a and c qualify as being true.
To me (a) does not seem true, because we only suggest garbage collection, we don't exactly invoke it. So how is (a) true?
Secondly,I know that the finalize method does not implicitly call its superclasses finalize. So you could explicitly invoke superclass' finalize method, but its not rule that
you should have to right? In that case (c) is not true.
Am I right?
