Discussion Board
Go to the previous messageThere are no next messages
Current Forum: Homework 2 Forum
Date: Sun Sep 16 2001 11:06 pm
Author: Agarwal, Aditya <adityaa@andrew.cmu.edu>
Subject: Re: How do i make a vector of Room ?

Well, in Java a vector does not any defined type. Hence, the same vector can contain different types of objects. This is the reason that you must cast whenever you remove anything from a vector.
Consider that you already have an object of type Room. Call it RoomA.
Then to add it to vector RoomList:
RoomList.add(RoomA);
That should do the job.
As for the other add that you are using, please lookup the syntax in the API documentation.
Post response

Go to the previous messageThere are no next messages
Current Thread Detail:
How do i make a vector of Room ?      Batra, Rohan      Sun Sep 16 2001 6:49 pm       
Re: How do i make a vector of      Agarwal, Aditya      Sun Sep 16 2001 11:06 pm       

Back to previous screen