Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inner All in one  RSS feed

 
tony kanvas
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, do you have a question about that code?
 
tony kanvas
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which compiler are you using?
It compiles fine with Java 1.3.1 on MacOS X 10.2.1.
 
Shishio San
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.4.1 on W2k
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Can you post the error message from that compiler?
 
Shishio San
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"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
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's strange, because I don't see an object or class called "InnerClasses" anywhere in that code.
 
Shishio San
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I should have told you taht. InnerClasses is a package i defined
 
Yan Bai
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tony kanvas:

Compile error happend at line 1 and 2.
 
tony kanvas
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!