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

Difference between start() and run() method of thread class?

590


Can set contain duplicates?

551


What is final variable?

497


What is the main difference between java platform and other platforms?

508


Is it possible for yielded thread to get chance for its execution again ?

554






What does java stand for?

559


How do you reverse a list?

556


What is treeset and treemap in java?

582


Where is const variable stored?

536


What is number data type in java?

559


What is static class

620


How big is a pointer?

555


What is string buffer?

506


What is bubble sorting in java?

595


Can you explain the final method modifier?

571