javaclass

tests/StaticTest.java

130:e82008ab3e71
2005-01-14 Paul Boddie Added the mainloop method.
     1 public class StaticTest {     2      3     public static StaticTestClass staticMember = StaticTestClass.newInstance();     4     public static StaticTestClass staticMember2 = StaticTestClass.newInstance(123);     5     public static int staticMember3 = StaticTestClass.getNumber();     6 }     7      8 class StaticTestClass {     9     public int x;    10     11     public StaticTestClass() {    12         x = 321;    13     }    14     15     public StaticTestClass(int x) {    16         this.x = x;    17     }    18     19     public static StaticTestClass newInstance() {    20         return new StaticTestClass();    21     }    22     23     public static StaticTestClass newInstance(int x) {    24         return new StaticTestClass(x);    25     }    26     27     public static int getNumber() {    28         return 456;    29     }    30 }