• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class inside interface

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I came to know that we can declare class inside an interface...

So i was wondering what is the use of declaring class inside an interface ???

Basically interface defines the contact between the class implementing the interface..

 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only difference between a top level class and a class defined in an interface is the different namespace. It's used very seldomly, but if it's used at all, then typically to communicate that the class is very tightly coupled to the interface.
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not supposed to be used. It's like appendix of human, I believe.

If I've time, I'll come up with more technical answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic