The process of disposing of dead objects is called garbage collection.
Encouraging the Java Virtual Machine (JVM) to do some garbage collecting and recover the memory.
class Sphere
{
double radius; // Radius of a sphere
Sphere()
{
} // Class constructor
Sphere(double theRadius)
{
radius = theRadius; // Set the radius
}
}
public class MainClass
{
public static void main(String[] arg)
{
Sphere sp = new Sphere();
System.gc();
}
}
Tuesday, September 30, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment