Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Class vector, help.

Thread Tools

Class vector, help.

Arturo Parisi
Posts: n/a
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?

Reply With Quote
Andrew Thompson
Posts: n/a
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
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Class A contains class B, class B points to class A Joseph Turian C++ 5 12-30-2005 03:24 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
A parameterized class (i.e. template class / class template) is not a class? christopher diggins C++ 16 05-04-2005 12:26 AM
Generic class literals - e.g,, Class<Map<String, Integer>>.class Purush Java 4 04-13-2005 08:40 PM
instanciate a class in a jar file with class.forname, while my main class is in another jar cyril Java 2 08-25-2004 06:55 AM