Vector judge = new Vector();
judge.addElement("abc");Type safety: The method addElement(Object) belongs to the raw type Vector. References to 
 generic type Vector<E> should be parameterized

解决方案 »

  1.   

    add(Object o)将对象O添加到向量的末尾
    或者用addElements(Object o)
      

  2.   

    JDK 1.5版本的新功能,需要对List,Vector之类定义时候,可以进行泛化。
    定义类型,如:Vector<String> v = new Vector<String>();
    这样的好处是再你add("abc");后想获取这个元素不需要再转化了。
    如,v.get(0)将返回的就是一个String对象。方便!