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
Explain about anonymous inner classes ?
What is the difference between hashmap and hashtable? What is an interface?
What are accessor methods in java?
What languages are pass by reference?
What are three ways in which a thread can enter the waiting state in java programming?
What is object cloning in Java?
What are features of java?
What’s the difference between applets and standalone program?
How do I print a “?
How does linkedlist work in java?
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?
What is comparable and comparator interface? List their differences
In java, how many ways you can take input from the console?
Is vector ordered in java?
Can we have any other return type than void for main method?