• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can an interface be implemented by an annonymous inner class?  RSS feed

 
Vishal Saxena
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Extending is very common - like below:

How about implementing?
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should be easy enough to try. Say, use MouseListener where you are now using MouseAdapter. Let us know the results!
 
Campbell Ritchie
Marshal
Posts: 56207
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Ess, you are quite right. The commonly used anonymous inner class when one adds an ActionListener is an example of that usage.

CR
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
Joe Ess, you are quite right. The commonly used anonymous inner class when one adds an ActionListener is an example of that usage.


I think Joe was hoping for the lightbulb to go on over the head of the original poster... Teach a man to fish and all that...
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well the notation is not obvious to te beginner.
...Nevermind. It should be obvious enough
[ June 13, 2006: Message edited by: Mr. C Lamont Gilbert ]
 
Campbell Ritchie
Marshal
Posts: 56207
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Teach a man to fish and all that...
Sorry
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!