Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Test your skills through the online practice test: Core Java Quiz Online Practice Test

Ques 171. Can an object's finalize() method be invoked while it is reachable?

An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.

Is it helpful? Add Comment View Comments
 

Ques 172. What is the purpose of garbage collection?

The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources may be reclaimed and reused.

Is it helpful? Add Comment View Comments
 

Ques 173. What is garbage collection? What is the process that is responsible for doing that in java?

Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process

Is it helpful? Add Comment View Comments
 

Ques 174. What kind of thread is the Garbage collector thread?

It is a daemon thread.

Is it helpful? Add Comment View Comments
 

Ques 175. What is the finalize method do?

Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook