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
What is an exception in java?
How to obtain a performance profile of java program
What is substring 1 in java?
Can we call virtual funciton in a constructor ?
What are the difference between string, string builder, and string buffer in java?
How do you use parseint in java?
What do you understand by abstract classes?
Why wait and notify methods are declared in object class?
What is increment in java?
What is the length of a string?
Explain where variables are created in memory?
Are maps ordered java?
Can we have multiple public classes in a java source file?
What is thread synchronization in java?
What is mean by exception?