• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

local-method inner class

 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
prashanth kumar
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use anonymous method local inner class or normal method local inner class to implement abstract class and than use it.

Hope This Helps
Prashanth
 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this,



FYI, there can also be a block(static and non-staic)local and constructor local inner classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic