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

Which class is used by server applications to obtain a port and listen for client requests?

475


How to find the given number is a prime number or not by getting input from the user

523


what is the purpose of the runtime class?

527


Difference between final and effectively final ?

610


What is finally and finalize in java?

572






What is the replace tool?

523


What is difference between path and classpath in java?

457


How do you create a null object?

486


What is a memory leak in java?

516


What is the base class of all exception classes in java?

550


What is collection class in java?

516


What is the console in java?

656


Why doesn't the java library use a randomized version of quicksort?

519


How java is similar to c?

563


What is a wrapper method?

512