wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: local-method inner class
 
Similar Threads
Question about Master Exam question
inquisition question
Abstract/Final Method-local Inner Class
about inner classes
Class Access Question