* tests/regression/jasmin/Makefile.am: Use JAVACMD as in other test dirs.
[cacao.git] / tests / gc / ClassInit.java
1 class ClassInitTest {
2         static {
3                 System.out.println("Static Initializer will call the GC ...");
4                 System.gc();
5         }
6
7         public static int val;
8
9         public static void test() {
10                 System.out.println("Static method fine.");
11         }
12 }
13
14 public class ClassInit {
15         public static void main(String[] s) {
16                 String t;
17
18                 System.out.println("Preparing a String ...");
19                 t = new String("Remember Me!");
20
21                 /*System.out.println("Static Test Method will be called ...");
22                 ClassInitTest.test();*/
23
24                 System.out.println("Static Field will be accessed ...");
25                 ClassInitTest.val = 123;
26
27                 System.out.println("String: " + t);
28                 System.out.println("Field:  " + ClassInitTest.val);
29                 System.out.println("Test fine.");
30         }
31 }