• Post Reply Bookmark Topic Watch Topic
  • New Topic

A question on Static Inner Class  RSS feed

 
Lisa Jon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I happend to read that:
1. The static inner class does not require a top level class object to create its object and
2. A static inner class can be placed inside an interface
Based on this understanding, I have written the below code:
// Static Inner class within an interface

----------------
Now I am wondering how I can access the inner2Method! I tried using Inner.Inner2.inner2Method() within the outDisplay() method of the top class and the program is compiling with an error!
myInterInClass.java:41: cannot resolve symbol
symbol : variable Inner2
location: class IntfaceInClas.Inner
Inner.Inner2.inner2Method();
^
how do i resolve this?
(edited by Cindy to format code using [ code] and [ /code] tags without the spaces)
[ January 15, 2003: Message edited by: Cindy Glass ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inner2 is defined in InnerDemo, so it probably should read
Inner.InnerDemo.Inner2...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!