aspose file tools*
The moose likes Beginning Java and the fly likes Inner-Outer class problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Inner-Outer class problem" Watch "Inner-Outer class problem" New topic
Author

Inner-Outer class problem

Abhimanyu Rathore
Ranch Hand

Joined: Jan 23, 2010
Posts: 32

Hey guys .. hope you could help again..
i am unable to understand why this prints "Inner" and not "Outer"..




Thanks in advance..
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

because Inner class A mask the Outer class A. to access the outer class A, you need to call the class with package name/fully qualified name.
Abhimanyu Rathore
Ranch Hand

Joined: Jan 23, 2010
Posts: 32

Seetharaman Venkatasamy wrote:because Inner class A mask the Outer class A. to access the outer class A, you need to call the class with package name/fully qualified name.


Thanks Venkat ..
But could you please elaborate.. what do i have to do, to simply invoke "outer go()"..
Thanks in return.. i appreciate..
Nick Jariwala
Greenhorn

Joined: Jun 01, 2011
Posts: 8


This code will invoke "outer go()". You'll have to put your code in a package.

Thanks,
Nikunj Jariwala
http://www.the-tech-talent.com/java
Abhimanyu Rathore
Ranch Hand

Joined: Jan 23, 2010
Posts: 32

Nick Jariwala wrote:

This code will invoke "outer go()". You'll have to put your code in a package.

Thanks,
Nikunj Jariwala
http://www.the-tech-talent.com/java

Thanks a lot Nikunj..
I got the Idea..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Inner-Outer class problem