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
Why object class is super class for every class in java?
How does singleton class work?
Is arraylist an object in java?
What is regex used for?
What are runtime exceptions?
How does multithreading take place on a computer with a single cpu?
How does arraylist size increase in java?
How do you use wildcards?
Why hashset is used in java?
What are static variables and functions?
Can we define private and protected modifiers for variables in interfaces?
What is method in research paper?
how would you implement a thread pool? : Java thread
How do you check if a string is lexicographically in java?
What happens if we override private method?