package com.maple.test;
public class A {
public A()
{
System.out.println("Class A has been constructed!");
}
class C {
private int i = 0;
public C()
{
i = -1;
System.out.println("inner class C of class A has been constructed!");
}
}
public void test()
{
C c = new C();
B b = new B(this);
}
/**
* @param args
*/
public static void main(String[] args) {
A a = new A();
a.test();
System.out.println("Done test.");
}
}
package com.maple.test;
public class B {
private A a = null;
public B(A a){
this.a = a;
System.out.println("class B has been constructed!");
}
}
public class A {
public A()
{
System.out.println("Class A has been constructed!");
}
class C {
private int i = 0;
public C()
{
i = -1;
System.out.println("inner class C of class A has been constructed!");
}
}
public void test()
{
C c = new C();
B b = new B(this);
}
/**
* @param args
*/
public static void main(String[] args) {
A a = new A();
a.test();
System.out.println("Done test.");
}
}
package com.maple.test;
public class B {
private A a = null;
public B(A a){
this.a = a;
System.out.println("class B has been constructed!");
}
}