D
Dan Upton
I have a simple class that basically stores some data in a char[][] plus
some extra useful things about it, and in an attempt to pass an
arbitrary number of these objects back and forth through method calls
I'm storing them all in a Vector. When I compile, javac tells me I
should recompile with -Xlint:unchecked ; when I do that, it gives me the
warning
PuzzleInput.java:157: warning: [unchecked] unchecked call to add(E) as a
member of the raw type java.util.Vector
pieces.add(newPiece);
For now, I fixed it by changing my initialization of pieces to be
Vector<Piece> = new Vector<Piece>();'
but I guess my actual question is if I know that my vector is only going
to be containing this one particular type of object in it, is there any
particular reason I should type the vector (other than to get the
compiler to leave me alone)?
some extra useful things about it, and in an attempt to pass an
arbitrary number of these objects back and forth through method calls
I'm storing them all in a Vector. When I compile, javac tells me I
should recompile with -Xlint:unchecked ; when I do that, it gives me the
warning
PuzzleInput.java:157: warning: [unchecked] unchecked call to add(E) as a
member of the raw type java.util.Vector
pieces.add(newPiece);
For now, I fixed it by changing my initialization of pieces to be
Vector<Piece> = new Vector<Piece>();'
but I guess my actual question is if I know that my vector is only going
to be containing this one particular type of object in it, is there any
particular reason I should type the vector (other than to get the
compiler to leave me alone)?