* tests/Makefile.am (EXTRA_DIST): Added $(srcdir) to actually find the
[cacao.git] / tests / gc / FinalExit.java
1 public class FinalExit {
2         public static final int N=8;
3
4         public int id;
5         
6         protected void finalize() throws Throwable {
7                 System.out.println("\tFinalized object #" + id);
8
9                 super.finalize();
10         }
11
12         public static void main(String args[]) {
13                 FinalExit f = null;
14
15                 System.out.println("Enabling runFinalizersOnExit ...");
16                 System.runFinalizersOnExit(true);
17
18                 System.out.println("Creating objects ...");
19                 for (int i=0; i<N; i++) {
20                         f = new FinalExit();
21                         f.id = i;
22                 }
23                 f = null;
24
25                 System.out.println("Shutting down ...");
26                 System.exit(0);
27         }
28 }