What is garbage collection in Java, and how can it be used ?

Answer Posted / syed sikandar bakht

when an object in memory is no longer refered by a variable,
the garbage collector automatically move it to garbage
collection.
instead of calling destructor JVM do it automatically, as we
use destructor in c++ to destroy the object.

Is This Answer Correct ?    20 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you override a private method in java?

486


Outline the major features of java.

557


What is square root in java?

577


Where are local variables stored?

497


How do you generate random numbers in java?

500






What is literal example?

549


What is stack class in java?

530


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

742


What is connection class in java?

497


describe synchronization in respect to multithreading? : Java thread

485


What is implicit object in java?

535


Explain about interthread communication and how it takes place in java?

528


What is bytecode verifier?

489


What restrictions are placed on method overloading in java programming?

557


What is final class?

565