![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I have the following lines taken from Thinking in Java by Bruce Eckel ,Chapter 8 Interfaces and Inner Classes . There Bruce says "IF you want to make an object of the inner class anywhere except from within a non-static method of the outer class , you must specify the type of that object as OuterClassName.InnerClassName ". that is to say , if you are accessing an Inner class "Inner" from a instance method of "Outer" then Inner in = ... whereas if you are accessing from a class method / static method however , when I tried to access the inner class from static method of the enclosing "Outer" class by saying Inner c = new Outer().new Inner(); It works fine This is not to point out the fault , I wanna know whether it works fine in all compilers and environments I did it on Windows environ , with Kawa IDE (the IDE does not matter however) on Jdk 1.2 Sridhar Visvanath
Replies:
|
Sponsored Links
|