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

Answer Posted / jitendra

An application running on a system computer uses some
memory, which makes memory management a significant issue
for any programming language. As Java is comparatively high-
level language, the memory management in Java is automatic.
To make it more efficient, we need to understand garbage
collection, i.e. freeing memory from objects that are no
longer in use.
Garbage collection is the process of automatically freeing
objects that are no longer referenced by the program. This
frees a programmer from having to keep track of when to
free allocated memory, thus preventing many potential bugs
and problems.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we create object of inner class in java?

487


What are the default and parameterized constructors?

543


Explain methods specific to list interface?

544


What is the main purpose of java?

504


what are abstract functions?

553






What is a "pure virtual" member function?

591


Say any two properties in beans?

626


How do you override a method in java?

524


How is string stored in java?

548


Can we force the garbage collection to run?

524


Is null in java?

541


What is the difference between array list and vector in java?

503


What is tochararray in java?

492


Difference between arraylist and hashset in java?

528


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

597