An interface extending an interface(I)
12 March 2008The subject topic is very interesting and I decided to write something on it. I hope it will be useful.
You know about the interfaces. They do not contain the implementation details, rather they contain the method signatures. The class implementing an interface, has to provide the implementation for each interface method. An interface in implemented using the keyword implements.
Class Room implements IOffice { …
The keyword extends is used for inheritance (re usability) and interfaces are not extended. For example, I tried to extend an interface and lets see what message I got:
public class Room extends IOffice { … }
Error:
The type IOffice cannot be a super class of Room; a superclass must be a class
So its clear not that interfaces are implemented and now extended. In the next post, I will do an interesting thing.
Related Posts:
- An interface extending an interface(II)
- Creating a Thread (implementing Java Runnable Interface)
- The Thread Class - I
- Threads In Java
- Interface extending Interface
- Behavioral Pattern - Iterator Pattern (Example) - 1
- Generating Interface from a Class
- Creating a Thread (extending Java Thread Class)
- Extract Interface (I)
- Extract Interface (II)
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: An interface extending an interface(I)