Java Garbage Collection Question and Answers
13. | When is an object subject to garbage collection? |
---|---|
An object is subject to garbage collection when it becomes unreachable to the program in which it is used. | |
14. | What kind of thread is the Garbage collector thread? |
---|---|
It is a daemon thread. | |
15. | What is finalize() method? |
---|---|
finalize() method is used just before an object is destroyed and can be called just prior to garbage collection. | |
16. | Does Java have destructors? |
---|---|
public void finalize() { } |
|