aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes method local inner class doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "method local inner class doubt" Watch "method local inner class doubt" New topic
Author

method local inner class doubt

adam Lui
Ranch Hand

Joined: Sep 03, 2007
Posts: 186


how is it possible to use that f() in localInner?


boolean b = true;<br />System.out.println ("I believe in Java.<br />Java will make my dream come " + b);
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by adam Lui:
...how is it possible to use that f() in localInner?

localInner.f() does not work because f() is not static (and inner classes cannot have static declarations). So you would need to create an instance of localInner, and call the method using that instance.
[ November 14, 2007: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: method local inner class doubt
 
Similar Threads
Inner class data access
Question regarind Inner Classes
invoking inner class method
mock question
problem about anonymous inner class