public class SecondClass
{
public SecondClass()
{
//System.err.println( " just entered constructor of SecondClass, calling ExampleStaticClass.getAString()..." );
//System.err.println( " in SecondClass constructor, before calling static class, free memory: " + Runtime.getRuntime().freeMemory() );
String aString = ExampleStaticClass.getAString();
//aString = null;
//System.err.println( " in SecondClass constructor, after calling static class, free memory: " + Runtime.getRuntime().freeMemory() );
//System.err.println( " leaving SecondClass constructor" );
}
public void finalize()
{
//System.err.println( " running finalize in SecondClass" );
//System.err.println( " SecondClass.finalize, free memory: " + Runtime.getRuntime().freeMemory() );
}
}
|