a question on an ap prep book

Discussion in 'Java' started by Eileen, Sep 7, 2008.

  1. Eileen

    Eileen Guest

    public class Tulip
    {
    private int numTulips;

    public Tulip(int nt)
    {
    numTulips = nt;
    }

    public String toString()
    {
    return "numTulips: " + numTulips;
    }
    }

    what is demonstrated by the Tulip class declaration?
    a. implementing an abstract method
    b. implementing an abstract interface
    c. composition
    d. overriding an inherited method
    e. multiple inheritance


    -------------------------------------------------------------
    first, java doesnt have multiple inheritance so (e) cant be true, and
    i dont think it inherites anything so to me (d) is false as well.
     
    Eileen, Sep 7, 2008
    #1
    1. Advertising

  2. Eileen

    Stefan Ram Guest

    Eileen <> writes:
    >first, java doesnt have multiple inheritance so (e) cant be true, and
    >i dont think it inherites anything so to me (d) is false as well.


    Java also does not have »abstract interfaces«.
     
    Stefan Ram, Sep 7, 2008
    #2
    1. Advertising

  3. Eileen wrote:
    > public class Tulip
    > {

    ....
    > first, java doesnt have multiple inheritance so (e) cant be true, and
    > i dont think it inherites anything so to me (d) is false as well.


    Remember that "public class Tulip {" is equivalent to "public class
    Tulip extends Object {".

    Patricia
     
    Patricia Shanahan, Sep 7, 2008
    #3
    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. jhon
    Replies:
    0
    Views:
    345
  2. jhon
    Replies:
    0
    Views:
    399
  3. Vijay
    Replies:
    1
    Views:
    576
    CBFalconer
    Jan 1, 2007
  4. Vijay
    Replies:
    0
    Views:
    508
    Vijay
    Jan 28, 2007
  5. maciek kanski
    Replies:
    2
    Views:
    303
Loading...

Share This Page