I know it is language-specific, but is it possible in OO-languages that interfaces implement other interfaces?
Asked
Active
Viewed 312 times
2
-
is this language agnositic or language specific? Are you asking for an answer for every OO language? – Matt Lacey Feb 09 '11 at 10:01
-
@Matt Lacey. No I'm just asking if it possible in any OO language – Feb 09 '11 at 10:02
-
Perhaps this is more a question about abstract object-oriented principles? Would it be *theoretically* possible for an interface to implement another interface? – Cody Gray - on strike Feb 09 '11 at 10:04
-
helpful question can be found here to http://stackoverflow.com/q/8531292/1055241 – gprathour Jan 27 '12 at 07:20
4 Answers
5
in C# you can do:
interface YourInterface: IDisposable {
/// your methods
}
and a class wich implements YourInterface
shall also implement IDisposable
's method.
Of course, then this is valid:
YourInterface implementation = new Implementation();
IDiposable disposable = implementation;

Simone
- 11,655
- 1
- 30
- 43
-
@Rofl: I've only ever seen the term "super interface" applied to Java, and I'm not a Java developer. What exactly does it mean, and if you're more comfortable with that language, why not ask the question specifically about Java? – Cody Gray - on strike Feb 09 '11 at 10:06
-
@Roflcoptr you name it. The point is that an object which implements YourInterface *is a" IDisposable too. – Simone Feb 09 '11 at 10:16
5
interface can extend but not implement another interface, since there is no implementation in the interface.

CloudyMarble
- 36,908
- 70
- 97
- 130
0
In simple words Implementation means applying set of predefined rules.interface is same like this.so an interface can not implement other interface.thats why we extend one interface with other