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