Our website is made possible by displaying online advertisements to our visitors.Please consider supporting us by disabling your ad blocker.
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Translate it in your own Language

Print this Job Post

Print Friendly and PDF

Tuesday, May 27, 2014

Garbage Collection Interview Questions

Question-117: What is Garbage Collection?
Garbage collection is a process of reclaiming the runtime unused objects.It is performed for memory management.

Question-118: What is gc()?
gc() is a daemon thread.gc() method is defined in System class that is used to send request to JVM to perform garbage collection.

Question-119: What is the purpose of finalize() method?
finalize() method is invoked just before the object is garbage collected.It is used to perform cleanup processing.

Question-120: Can an unrefrenced objects be refrenced again?

Question-121: What kind of thread is the Garbage collector thread?
Daemon thread.

Question-122: What is difference between final, finally and finalize?

  1. final: final is a keyword, final can be variable, method or class.You, can’t change the value of final variable, can’t override final method, can’t inherit final class.
  2. finally: finally block is used in exception handling. finally block is always executed.
  3. finalize():finalize() method is used in garbage collection.finalize() method is invoked just before the object is garbage collected.The finalize() method can be used to perform any cleanup processing.

Question-123:What is the purpose of the Runtime class?
The purpose of the Runtime class is to provide access to the Java runtime system.

Question-124: How will you invoke any external process in Java?
By Runtime.getRuntime().exec(?) method.

I/O Interview Questions

No comments:

Post a Comment

Copyright @ CrackMNC 2014-2024
Divas Nikhra Theme by Crack MNC