What is garbage collection in Java, and how can it be used ?
Answer Posted / rahulmishra642
1>Garbage collection is a deamon thread which runs at the background to support the nin deamon thread.
2>garbage collector is responsible to destroy the useless objects.
3>An obejct is eligible for GC if and only if it doesn;t have any reference.
4>we can also call GC explicitly by System Class and Runtime class
By System Class:
- System.gc();
By Runtime Class
-Runtime r = Runtime.getRuntime(); (here we are creating runtime object by using factory method)
now, you can call gc() method
-r.gc();
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is singleton set an interval?
What is java util list?
How is treeset implemented in java?
What is the difference between jfc & wfc?
Is java a compiler?
Why doesn't the java library use a randomized version of quicksort?
Why java does not support pointers?
What is space character in java?
Can we clone singleton class in java?
Write a program based on Java script program.
How do you write methodology?
What is a variable analysis?
Why does java doesnt suuport unsigned values?
What is high level language in computer?
Why is the main method static?