Answer Posted / uv
As far as I know,it is not required to call the garbage
collector.
It automatically and periodically removes the unused
objects by an algorithm known as "Mark and Sweep".
However, if we intentionally want to call it then the above
suggestions are perfect.
Anyone who feels that it is incorrect, please feel free to
correct me.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the difference between hashmap and hashtable? What is an interface?
Is char a data type in java?
What is primitive data type in java?
In case of inheritance what is the execution order of constructor and destructor?
How do you escape json?
How do you remove all elements from an arraylist in java?
Why java is platform independent? Explain.
What means public static?
Explain numeric promotion?
What is a programming object?
What is the purpose of using java.lang.class class?
Explain exception chaining in java?
What does microservices mean?
What is the purpose of the finally clause of a try-catch-finally statement in java programming?
Does set allows null in java?