Dear sir when i am compiling above code then jvm showing an error message that java warning [unchecked] unchecked call to addElement[E] as a memeber of raw type java.util why sir what wrong with above code?
Arun kumar maalik
posted 10 years ago
As of Java 5.0, the class Vector has been parameterized, meaning that you need to indicate what type of element your Vector object will hold.
If you compile the above code using javac -source 1.4, no unchecked warning will be thrown. This is because generics do not exist in Java 1.4.
As you want to add a String to a Vector, in Java 5.0, this should be written as:
Perhaps you should go through generics first. [ August 16, 2006: Message edited by: Aniket Patil ]
SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!