Implimenting Interfaces

Discussion in 'Java' started by Java Buai, Feb 23, 2006.

  1. Java Buai

    Java Buai Guest

    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
     
    Java Buai, Feb 23, 2006
    #1
    1. Advertising

  2. Java Buai

    Bart Cremers Guest

    Any interface can "extend" any number of other interfaces.

    Bart
     
    Bart Cremers, Feb 23, 2006
    #2
    1. Advertising

  3. Java Buai wrote:
    > 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
     
    tom fredriksen, Feb 23, 2006
    #3
  4. Java Buai

    Roedy Green Guest

    On Thu, 23 Feb 2006 15:31:03 +0100, tom fredriksen <>
    wrote, quoted or indirectly quoted someone who said :

    >> 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



    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Feb 23, 2006
    #4
  5. Java Buai

    Ian Shef Guest

    "Java Buai" <> 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




    --
    Ian Shef 805/F6 * These are my personal opinions
    Raytheon Company * and not those of my employer.
    PO Box 11337 *
    Tucson, AZ 85734-1337 *
     
    Ian Shef, Mar 16, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shade
    Replies:
    1
    Views:
    1,676
  2. William F. Robertson, Jr.

    C# interfaces

    William F. Robertson, Jr., Jul 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    469
    [Gauthier]
    Jul 3, 2003
  3. Guest

    Python-implimenting-valueweb

    Guest, Apr 1, 2006, in forum: Python
    Replies:
    0
    Views:
    238
    Guest
    Apr 1, 2006
  4. mark r

    help implimenting bad words filter

    mark r, Jun 3, 2007, in forum: ASP General
    Replies:
    0
    Views:
    122
    mark r
    Jun 3, 2007
  5. Bishnu Das
    Replies:
    1
    Views:
    379
    John Mettraux
    Mar 24, 2008
Loading...

Share This Page