mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-20 12:19:27 +08:00
ee9dd3721b
From-SVN: r26263
29 lines
464 B
Java
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 ");
|
|
}
|
|
}
|