class MyClass {
MyClass(int marker) {
System.out.println("Cup(" + marker + ")");
}
void f(int marker) {
System.out.println("f(" + marker + ")");
}
}
class MyStatic {
static MyClass c1;
static MyClass c2;
static {
c1 = new MyClass(1);
c2 = new MyClass(2);
}
MyStatic() {
System.out.println("Cups()");
}
}
public class MainClass {
public static void main(String[] args) {
System.out.println("Inside main()");
MyStatic.c1.f(99); // (1)
}
}
|