Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Class vector, help.

 
 
Arturo Parisi
Guest
Posts: n/a
 
      09-06-2004
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");

v.add(uno);
v.add(due);

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?
Thanks.


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      09-06-2004
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..
* <http://www.physci.org/codes/javafaq.jsp#netiquette>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
Reply

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



Advertisments