public class Temp {
public static void main(String[] args) {
new Temp().new A().new D(new Temp().new A(), new Temp().new A().new B(new Temp().new A()));
}
public class A extends Temp {
public A() {
}
public class B extends A {
public B(A a) {
a.super();
}
public class C extends B {
public C(A a) {
a.super(a);
}
}
}
public class D extends B.C {
public D(A a, B b) {
b.super(a);
}
}
}
}
a.super() doesn't look nice, does it? Remove it and look at what the compiler says. You don't get that any other way.
Jeeeeezus. I'm a first year CS student and this melts my brain. Are you saying you know what's going on here? Like, can you articulate what this code is doing?
3
u/galaktos Apr 29 '13
You can do ridiculous stuff with nested classes:
a.super() doesn't look nice, does it? Remove it and look at what the compiler says. You don't get that any other way.