1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/StaticTest.java Sat Nov 20 21:46:46 2004 +0100
1.3 @@ -0,0 +1,30 @@
1.4 +public class StaticTest {
1.5 +
1.6 + public static StaticTestClass staticMember = StaticTestClass.newInstance();
1.7 + public static StaticTestClass staticMember2 = StaticTestClass.newInstance(123);
1.8 + public static int staticMember3 = StaticTestClass.getNumber();
1.9 +}
1.10 +
1.11 +class StaticTestClass {
1.12 + public int x;
1.13 +
1.14 + public StaticTestClass() {
1.15 + x = 321;
1.16 + }
1.17 +
1.18 + public StaticTestClass(int x) {
1.19 + this.x = x;
1.20 + }
1.21 +
1.22 + public static StaticTestClass newInstance() {
1.23 + return new StaticTestClass();
1.24 + }
1.25 +
1.26 + public static StaticTestClass newInstance(int x) {
1.27 + return new StaticTestClass(x);
1.28 + }
1.29 +
1.30 + public static int getNumber() {
1.31 + return 456;
1.32 + }
1.33 +}