How to send a request to garbage collector?

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


Please Help Members By Posting Answers For Below Questions

Name some classes present in java.util.regex package.

693


Are registers volatile?

630


How can a gui component handle its own events in java programming?

633


How do I remove a character from a string in java?

600


What is the difference between an if statement and a switch statement?

754






Define packages in java?

673


why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

630


What is pass by value?

598


what is the difference between preemptive scheduling and time slicing? : Java thread

630


When does a class need a virtual destructor?

632


Can we override private methods?

651


When should I use stringbuffer?

659


What is output buffer?

657


Is null in java?

644


How do you calculate roots in java?

631