• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface

 
soujanya Bugatha
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to define a class inside an interface ? I read that we can declare public abstract methods and final variables inside an interface but i never came across any code which defines a class inside an interface. please explain me.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can define a class inside an interface. and this class is implicitly public static . in this way one can give a default implementation to clients(there are many other better way though).
 
Adriano Ribeiro
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us an example? Thanks.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adriano Ribeiro wrote:Can you give us an example?


 
Kevin Florish
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an interesting topic!

Being a devil's advocate here, maybe we could discuss the following quote from Seetharaman:

you can define a class inside an interface. and this class is implicitly public static . in this way one can give a default implementation to clients(there are many other better way though).


Interested in replies
 
sharma ishu
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kevin Florish wrote:This is an interesting topic!

Being a devil's advocate here, maybe we could discuss the following quote from Seetharaman:

you can define a class inside an interface. and this class is implicitly public static . in this way one can give a default implementation to clients(there are many other better way though).


Interested in replies

What does the "default implementation" mean here?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic