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

Answer Posted / sivadasan

Garbage collection is a thread, that runs to reclaim the
memory by destroying objects which object is cannot be
referenced anymore.

Deleting Dynamically created objects from the memory.

Finalize method used to achieve garbage collection.

By using Runtime.gc() or System.gc() the object will be
garbage collected.

Is This Answer Correct ?    30 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is constant in programming?

560


What are the different ways to handle exceptions?

544


What is structure of java heap? What is perm gen space in heap?

546


How do you convert int to char in java?

577


Why does java not support operator overloading?

663






Which variable is the independent variable?

544


How can we create a thread in java?

589


Which methods are used during serialization and deserialization process?

555


Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview

2857


Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..

1826


Can this keyword be used to refer static members?

551


Write a method that will remove given character from the string?

579


Can an anonymous class be declared as implementing an interface and extending a class in java programming?

651


What is args length in java?

669


What is entry in java?

537