This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes local-method inner class 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "local-method inner class" Watch "local-method inner class" New topic
Author

local-method inner class

Anthony Karta
Ranch Hand

Joined: Aug 09, 2004
Posts: 342
Two points from KB book:
-declare/define inside a method, same level as local variables.
-can only have access modifier: final and abstract

But if we mark local-method inner class as abstract, how to use it?

thanks


SCJP 5
prashanth kumar
Ranch Hand

Joined: Mar 22, 2004
Posts: 162
Use anonymous method local inner class or normal method local inner class to implement abstract class and than use it.

Hope This Helps
Prashanth


SCJP1.5(86%)<br />SCWCD1.4(95%)<br />SCBCD1.3(92%)<br />IBM 252
Anthony Karta
Ranch Hand

Joined: Aug 09, 2004
Posts: 342
Originally posted by prashanth kumar:
Use anonymous method local inner class or normal method local inner class to implement abstract class and than use it.

Hope This Helps
Prashanth



could you give me an example please?

I try something like this "class MyInner2 implements MyOuter.MyInner { ... }"

thanks
Praveen Babu
Ranch Hand

Joined: Jul 30, 2006
Posts: 138
Try this,



FYI, there can also be a block(static and non-staic)local and constructor local inner classes.
 
 
subject: local-method inner class