Java Reference
In-Depth Information
< Day Day Up >
Puzzle 90: It's Absurd, It's a Pain, It's Superclass!
The following program doesn't actually do anything. Worse, it won't compile. Why not? How can
you fix it?
public class Outer {
class Inner1 extends Outer {}
class Inner2 extends Inner1 {}
}
Solution 90: It's Absurd, It's a Pain, It's Superclass
This program looks too simple to have anything wrong with it, but if you try to compile it, you get
this helpful error message:
Outer.java:3: cannot reference this before
supertype constructor has been called
 
 
Search WWH ::




Custom Search