Originally posted by John Stone:
So, you are not able to compile my code?
Because, it works fine for me. It's based on one example from Thinking in Java 3rd edition, so it should also work with Java 1.4
I am using a Java 1.6 compiler. Could that be the problem? I then tried using the -source option of javac, I have appended below stuff that I tried on my PC-
C:\SCJPCode>javac -d classes -source 1.5 scjp\Outer1.java
scjp\Outer1.java:26: an enclosing instance that contains scjp.Outer1.Inner is required
class Outer2 extends Outer1.Inner { }
^
1 error
C:\SCJPCode>javac -d classes -source 1.4 scjp\Outer1.java
scjp\Outer1.java:26: an enclosing instance that contains scjp.Outer1.Inner is required
class Outer2 extends Outer1.Inner { }
^
1 error
So as you can see, no luck!!
Regards
Percy