Class vector, help.

Discussion in 'Java' started by Arturo Parisi, Sep 6, 2004.

  1. I have created the class Room. I'd create e vector of Room.
    I declare a vector in this way:

    Vector v = new Vector();

    Room uno = new Room();
    Room due = new Room(1, "aldo", "pollo", "sempronio");


    But if I want to do v.get(0).setName("OK"); the compiler gives me an error.
    The vector that I have created is generic, how can I create a Room Vector?
    Arturo Parisi, Sep 6, 2004
    1. Advertisements

  2. On Mon, 06 Sep 2004 16:37:49 GMT, Arturo Parisi wrote:

    > I have created the class Room.

    You have also multi-posted*, please
    see my answer on the other group.

    Please also refrain from multi-posting..
    * <>

    Andrew Thompson Open-source software suite Web & IT Help Science & Technology
    Andrew Thompson, Sep 6, 2004
    1. Advertisements

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.