newbie question: Extends and implements

Discussion in 'Java' started by Jacky Luk, Nov 22, 2005.

  1. Jacky Luk

    Jacky Luk Guest

    I have been programming with VC++ for many years. Now I would like to extend
    my knowledge to Java. I'd like to know what "Extends" and "Implements"
    keywords in the class declaration do... Thanks in advance
    Jack
    Jacky Luk, Nov 22, 2005
    #1
    1. Advertising

  2. "Jacky Luk" <> wrote in message news:4382df17$1@127.0.0.1...
    >I have been programming with VC++ for many years. Now I would like to
    >extend my knowledge to Java. I'd like to know what "Extends" and
    >"Implements" keywords in the class declaration do... Thanks in advance
    > Jack


    Extends is just standard class inheritance.

    Implements is similar, but only abstract functions can be derived (no
    attributes.)

    This question seems to be jumping into the middle, however. I suggest you
    get a Java book and start from the beginning. If you all ready know how to
    program, you should be able to go very quickly through any tutorial or book.

    --
    LTP

    :)
    Luc The Perverse, Nov 22, 2005
    #2
    1. Advertising

  3. Jacky Luk

    Jacky Luk Guest

    Thank you so much
    Jack

    "Luc The Perverse" <> ¼¶¼g©ó¶l¥ó·s»D:4382ecda$0$8246$...
    > "Jacky Luk" <> wrote in message news:4382df17$1@127.0.0.1...
    >>I have been programming with VC++ for many years. Now I would like to
    >>extend my knowledge to Java. I'd like to know what "Extends" and
    >>"Implements" keywords in the class declaration do... Thanks in advance
    >> Jack

    >
    > Extends is just standard class inheritance.
    >
    > Implements is similar, but only abstract functions can be derived (no
    > attributes.)
    >
    > This question seems to be jumping into the middle, however. I suggest you
    > get a Java book and start from the beginning. If you all ready know how
    > to program, you should be able to go very quickly through any tutorial or
    > book.
    >
    > --
    > LTP
    >
    > :)
    >
    Jacky Luk, Nov 22, 2005
    #3
  4. Jacky Luk

    Roedy Green Guest

    On Tue, 22 Nov 2005 17:04:24 +0800, "Jacky Luk" <> wrote,
    quoted or indirectly quoted someone who said :

    >I have been programming with VC++ for many years. Now I would like to extend
    >my knowledge to Java. I'd like to know what "Extends" and "Implements"
    >keywords in the class declaration do... Thanks in advance

    see http://mindprod.com/gettingstarted.html

    You will need a text book for that. Read a text first before posting
    any more questions, or you will find people refusing to answer you
    later when you ask questions not in every elementary textbook.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Nov 22, 2005
    #4
  5. Jacky Luk

    Bhupendra Guest

    extends:-
    in java extends keyword is used for inheritence from only one class

    example

    public class demo extends Frame \\\legal declaration
    { ......... }

    public class demo extends Frame, Applet \\\illegal declaration
    { ......... }

    implementation Keyword: -

    The implements keyword is used for multiple inheritence in java, but
    you can only implement only interface (which same as like abstract
    classes in C++ but only difference is here that no methods should have
    body in interface.

    example:

    inteface demoInterface1
    {
    public void demoMethod(int demoVar);
    }

    inteface demoInterface2
    {
    public void demoMethod(int demoVar);
    }

    public class demo extends Frame implements demoInterface1,
    demoInterface2
    {.................................}

    Here you are extending Frame class and implementing multiple interface
    demoInteface1, demoInteface2 but the methods body of the the interface
    methods will be written in class where the inteface has been
    implemented.
    Bhupendra, Nov 23, 2005
    #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. Jordan Smith

    Implements and Interface

    Jordan Smith, Nov 27, 2003, in forum: Java
    Replies:
    3
    Views:
    388
    Joona I Palaste
    Nov 28, 2003
  2. Stacey
    Replies:
    0
    Views:
    2,145
    Stacey
    Jan 20, 2004
  3. Replies:
    8
    Views:
    526
  4. Replies:
    2
    Views:
    903
    F. Marker
    Feb 16, 2007
  5. Alpha Blue
    Replies:
    0
    Views:
    99
    Alpha Blue
    Jan 30, 2010
Loading...

Share This Page