What is garbage collection in Java, and how can it be used ?

Answer Posted / janet

When an object is no longer referred to by any
variable,java automatically reclaims memory used by that
object.This is known as garbage collection.
System.gc() method may be used to call it explicitly.

Is This Answer Correct ?    182 Yes 34 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is array an object in java?

636


Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

633


Which is better ascii or unicode?

661


What are class members by default?

748


What is the size of int in 64-bit jvm?

633






Is a case study a method or methodology?

541


Who developed java?

648


Which is easier .net or java?

748


What is a string token?

622


why would you use a synchronized block vs. Synchronized method? : Java thread

614


Can you override private or static method in java?

640


What is classname class in java?

632


Can inner class final?

751


What is bitwise complement?

601


Where is the find and replace?

626