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

Can you explain the cs option of java interpreter?

504


What is the arraylist in java?

528


What will be the initial value of an object reference which is defined as an instance variable?

629


Why main method is static in java?

588


What types of index data structures can you have in java?

612






is there a separate stack for each thread in java? : Java thread

536


How do you create a reference in java?

508


What is hash in java?

515


What is the synonym of string?

531


What is bom encoding?

552


How many types of keywords are there?

561


How will you print number in reverse (descending) order in BST.

576


Why chararray() is preferred over string to store the password?

524


What is the final keyword denotes?

672


What does snprintf return?

544