1 Reply Latest reply on Jul 30, 2011 6:26 PM by 802316

    Convert ArrayList to Vector - performance

      I have a method which needs to return a Vector object. Now, I realize that I dont really need it to be a Vector here and an ArrayList would do the job too since i dont need a synchronized collection. However, due to framework limitations, the return type must be a vector.

      I was wondering if I could improve performance if I add objects to an ArrayList, and convert it into a Vector by doing something like

      List list = new ArrayList();

      return new Vector(list);

      Or would simply adding objects to a Vector be better than doing the above/