Answer Posted / anjum rehbar khan
Yes we can send arequest to garbage collection by writing a
simple line of code:
System.gc();
OR
Runtime.gc();
But it is simply a request not a order to JVM
because Garbage collection is JVM dependent
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What are methods in java?
What are the wrapped, classes?
What is collection class in java? List down its methods and interfaces.
Can a class be declared as protected?
What is default size of arraylist in java?
Does sprintf allocate memory?
What is the difference between comparison done by equals method and == operator?
What is the public field modifier?
What's the purpose of static methods and static variables?
Can you explain the meaning of aggregation and composition
What is a stringbuilder?
What is string manipulation?
When the constructor of a class is invoked?
When will we prefer to use set and list in java and why?
Is an array a vector?