Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner All in one Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner All in one" Watch "Inner All in one" New topic
Author

Inner All in one

tony kanvas
Ranch Hand

Joined: Oct 26, 2002
Posts: 97
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Yes, do you have a question about that code?


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
tony kanvas
Ranch Hand

Joined: Oct 26, 2002
Posts: 97
hi ron,
It�s difficult to remember some thing like that ��.
Need some explanations to remember all type of calling inner class
Thanks in advance
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Which parts of this code do you not understand? If you can ask a specific question, we can be more helpful.
Shishio San
Ranch Hand

Joined: Aug 29, 2002
Posts: 223
Originally posted by tony kanvas:

Maybe i should point out that the code above won't compile. You can't use new Outer32().new Inner() to declare an instance of a Nested Top-Level class. It's not associated with an instance of the enclosing class but with the enclosing class itslef.
Hope this helps.


Whatever doesn't kill us ...<br />Is probably circling back for another try.<br />SCJP 1.4
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Which compiler are you using?
It compiles fine with Java 1.3.1 on MacOS X 10.2.1.
Shishio San
Ranch Hand

Joined: Aug 29, 2002
Posts: 223
1.4.1 on W2k
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Thanks. Can you post the error message from that compiler?
Shishio San
Ranch Hand

Joined: Aug 29, 2002
Posts: 223

"InnerAllInOne.java": Error #: 479 : illegal qualifier; class InnerClasses.Outer32.Inner is not an inner class at line 35, column 41
"InnerAllInOne.java": Error #: 479 : illegal qualifier; class InnerClasses.Outer32.Inner is not an inner class at line 38, column 34
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
That's strange, because I don't see an object or class called "InnerClasses" anywhere in that code.
Shishio San
Ranch Hand

Joined: Aug 29, 2002
Posts: 223
Sorry, I should have told you taht. InnerClasses is a package i defined
Yan Bai
Ranch Hand

Joined: Jul 21, 2002
Posts: 125
Originally posted by tony kanvas:

Compile error happend at line 1 and 2.


SCJP 1.4
tony kanvas
Ranch Hand

Joined: Oct 26, 2002
Posts: 97
Hi Ron
If you don�t mind to give me small explanations about when we can use those cases and why??!
Thanks for having some patience with me.
Yours respectfully Tony
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Inner All in one
 
Similar Threads
Creation of Ineger Wrapper Object
Arrays
Inner class question in Sahir Shah's Mock Exam
Isolating a Reference
Integer unboxing and == operator question