• 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

InnerClass call access

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am not able call P669_MyInner04 from Line 23, In Line 4, I am able to create instance.
 
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instance member just CANNOT be called from static context without instance of the outer class
isn't that simple
for getting the instance, you will have to create instance of outer class
and then you can access the inner class as regular inner class acts just like INSTANCE MEMBERS

AND STATIC CONTEXT CAN ACCESS STATIC FIELDS DIRECTLY

for accessing the regular inner class
we will have to first create object of P669_MyOuter05_Ask

now following code should work
 
reply
    Bookmark Topic Watch Topic
  • New Topic