0
how can I create an instance with a reference to an object that was created at the beginning of the program?
Class A { Class B { // how to reference Object A? } public static void main() { A a = new A(); a.method(); } }
1 Respuesta
+ 2
public class A {
public static int i = 30;
public class B { int j = 4;
public class C { int k = i;
}
}
}
Objects:
A a = new A();
A.B b = a.new B();
A.B.C c = b.new C();