gcc/libjava/testsuite/libjava.lang/Finalize_1.java
Tom Tromey ee9dd3721b Initial revision
From-SVN: r26263
1999-04-07 14:42:40 +00:00

29 lines
464 B
Java

// Finalize.java - Test code for finalizers.
import java.io.*;
import java.util.*;
import java.lang.Runtime;
public final class Finalize_1
{
public static void main (String[] args)
{
Finalize_1 f;
Runtime t;
t = Runtime.getRuntime ();
for (int i = 0; i < 3; ++i)
f = new Finalize_1 ();
f = null;
t.gc ();
t.runFinalization ();
}
public void finalize () throws Throwable
{
System.out.print ("Finalize ");
}
}