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

When should I use a singleton?

563


What is bifunction in java?

682


What is the longest unicode character?

695


what is meant by Garbage collection?

622


What are the restrictions imposed on method overriding?

558






What is difference between iterator access and index access?

649


What do you understand by Header linked List?

602


State the difference between creating string as new () and literal.

528


What are strings in physics?

549


What is the difference between a synchronized method and a synchronized block?

611


What is the properties class?

563


Is arraylist a class in java?

538


Is special character in java?

616


Can we override static methods in java?

591


What are the four corner stones of oop?

549