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

Answer Posted / rintu kumar kanp

Finding garbage and reclaiming memory allocated to it.
Garbage holds unreferenced objects
ex:-
Student ali= new Student();
Student khalid= new Student();
ali=khalid;
Now ali Object becomes a garbage,
It is unreferenced Object


it be used When the total memory allocated to a Java
program exceeds some threshold.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you compare objects in java?

591


What is the program development process?

648


How does split work in java?

622


What is busy spin, and why should you use it?

688


What do you know about the garbage collector?

694






What is hashing principle in java?

649


How many types of voids are there?

628


What is a void in java?

667


What is json parser in java?

706


Write code of any action class?

633


What is array size in java?

602


What are the difference between string, string builder, and string buffer in java?

633


What is a heavyweight component?

622


What is java reflection?

628


Is vector synchronized in java?

645