public class Outer2 {
Outer2(){
System.out.println("Calling Outer2 constructor");
System.out.println(this.getClass().getName() + ": Inner class reference is " + this);
System.out.println(Outer2.this + ": Outer class reference is " + Outer2.this);
}
class Inner1 extends Outer2 {
Inner1() {
System.out.println("Calling Inner1 constructor");
System.out.println(this.getClass().getName() + ": Inner class reference is " + this);
System.out.println(Outer2.this + ": Outer class reference is " + Outer2.this);
}
}
class Inner2 extends Inner1 {
Inner2() {
System.out.println("Calling Inner2 constructor");
System.out.println(this.getClass().getName() + ": Inner class reference is " + this);
System.out.println(Outer2.this + ": Outer class reference is " + Outer2.this);
}
}
public static void main(String[] args) {
new Outer2().new Inner2();
}
public class Outer2 {
Outer2(){
System.ou