Hey, I am writing a class called Pair which extends the Vector class. The constructor and add methods are the same as the Vector class. So I can create a new Pair object by:
Now, I want to add objects of another user-defined class called Player to this Pair object.
This is a problem, because it gives me "unchecked operation" errors because the raw type of Vector is not matching. How do I get rid of them? Do I have to override the constructor or the add method of the Vector class in a particular fashion to get rid of this error? [ December 08, 2004: Message edited by: Tobie Henderson ]
Joined: Nov 15, 2004
FWIW, I solved the problem. I just changed the class definition of Pair to which was previously:
so that it can handle Player objects. Then I create a new Pair object by saying: