private void addAdd(Collection c)
    Vector v = getDataVector();
    v.addAll(c);
}

解决方案 »

  1.   

    Vector vec=(Vector)ClassName.narrow(Collecion,anotherClass.class)
      

  2.   

    请问 getDataVector() 里面的是什么内容。className.narrow 是什么?
    anotherClass.class 是什么?
    请教了......
      

  3.   

    public Vector getValueObject(Collection coll)
       {Vector  vc = null;
        return   vc.addAll(coll);
       }
      

  4.   

    Romeo1982(只爱CS) : 根据你的意思,整理如下,但是出错,麻烦你帮我修改一下,谢谢public Vector getValueObject()
       {
         Collection coll = null ;
         Vector  vc = null; 
         vc.addAll(coll);  //这里就出错!java.lang.NullPointerException
         return vc;
       }Vector dataVector = getValueObject();
    dataVector.addAll(userList);
      

  5.   

    public Vector getValueObject(Collection coll)
       {
         Vector  vc = new Vector(); 
         vc.addAll(coll); 
         return vc;
       }
      

  6.   

    Vector的其中一个构造函授。
    Vector(Collection c) 
    只要一句话:Vector vecVar = new Vector(你欲转化的Collection变数)。
      

  7.   

    chenchen2003(晨辰) :
    谢谢,果然是如此。
    谢谢各位!
      

  8.   

    呵呵,有问题可以多看JDK文档,上面都很全
      

  9.   

    谁有JDK文档,请发 一份,谢谢
    [email protected]