Top 50+ Java Garbage Collections Interview Questions and Answers - 2
Question: 6
Describe the Garbage Collection process in Java?
The JVM spec mandates automatic garbage collection outside of the programmer’s control.
The System.gc() or Runtime.gc() is merely a suggestion to the JVM to run the GC process but is NOT guaranteed.
Question: 7
Explain the keywords native, transient, volatile, finally.
native – to use methods which written in other language.
transient – if u declare state of a class as transient then it’s not saved in persistent area.
volatile – this is not optimized at the time of optimization because its value may be changed implicitly or explicitly.
finally – finally is used to do work prior of closing the program because of exception. It’s always called be compiler either exception generated or not.
Question: 8
What kind of thread is the Garbage collector thread?
It is a daemon thread.
Question: 9
If an object is garbage collected, can it become reachable again?
Once an object is garbage collected, it ceases to exist. It can no longer become reachable again.
Question: 10
How will you invoke any external process in Java?
By Runtime.getRuntime().exec(?) method
Power Semiconductor Device and Integrated Circuits Questions More
Strength of Materials Questions and Answers Pdf More
Steam and Power Generation Quiz Questions & Answers Pdf More
Dc generator questions and answers pdf More
DC Generator Questions and Answers Pdf More
100+ Technical Quiz Questions and Answers in Computer Science More
7000+ GK Questions on Famous Places in India More
Physics Interview Questions and Answers Pdf More
1000+ Sentence Improvement Questions for SSC CGL Tier 1, Tier 2 Pdf More
100+ Transformation of Substances Question Answer More