Hi all,
I am very new to Java programming, just learning in fact. Now doing
inheritance of classes and interfaces but need to know:
is it possible for an interface to impliment another interface.
I know a class can impliment any number of interfaces.
Thanks,
Java Buai
Bart Cremers - 23 Feb 2006 11:16 GMT
Any interface can "extend" any number of other interfaces.
Bart
tom fredriksen - 23 Feb 2006 14:31 GMT
> is it possible for an interface to impliment another interface.
An interface is an abstract entity which only declares methods names, so
there can not be any "implements". Only classes can do that. An
interface can only be extended.
/tom
Roedy Green - 23 Feb 2006 15:29 GMT
>> is it possible for an interface to impliment another interface.
>
>An interface is an abstract entity which only declares methods names, so
>there can not be any "implements". Only classes can do that. An
>interface can only be extended.
see http://mindprod.com/jgloss/implement.html
http://mindprod.com/jgloss/extend.html
the terminology in Java is illogical in two respects. I discuss the
absurdities in those links. No wonder it makes no sense to you.
to add insult to injury they extend interfaces in generics. I think
at some point they may be declared equivalent, or you code either way
an and IDE cleans it up.
Perhaps some day either "extends" or "implements" will be deprecated.
Or you will be allowed to implement abstract classes and extend
interfaces with abstract classes. The compiler always knows what you
mean. It is mother-may-I game akin to venery hazing.
See http://mindprod.com/jgloss/venery.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Ian Shef - 16 Mar 2006 21:14 GMT
"Java Buai" <homer.slack@ntlworld.com> wrote in news:QHgLf.59671$mf2.918
@newsfe6-win.ntli.net:
> Hi all,
>
> I am very new to Java programming, just learning in fact. Now doing
> inheritance of classes and interfaces but need to know:
>
> is it possible for an interface to impliment another interface.
There is no implementation code in an interface, so it cannot IMPLEMENT
another interface. However, an interface can EXTEND one or more interfaces.
Examples can be found in the javadocs. For example,
in javax.swing.event.MouseInputListener
public interface MouseInputListenerextends MouseListener,
MouseMotionListener
and in java.awt.event MouseListener
public interface MouseListener extends EventListener
and at the head of the chain in java.util EventListener
public interface EventListener

Signature
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *