• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inner-Outer class problem

 
Ranch Hand
Posts: 32
Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys .. hope you could help again..
i am unable to understand why this prints "Inner" and not "Outer"..




Thanks in advance..
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 32
Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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..
 
Greenhorn
Posts: 8
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
Posts: 32
Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic