I’m not really sure what is wrong with my code…
public Vector blob (Pixel px)
{
Vector v = new Vector();
Point p = new Point(px.getX(), px.getY());
v.add(p);
return v;
}
I get the following: warning: [unchecked] unchecked call to add(E) as a member of the raw type Vector
v.add(p);
where E is a type-variable: E extends Object declared in class Vector.
Looking through the API, the add function takes an object as a param which I clearly make the line before, ideas?
Generics!!!. You have to specify the Object type for the contents of the vector.
To remove the warning the vector code should be like this