About 50 results
Open links in new tab
  1. java - What are the differences between ArrayList and Vector? - Stack ...

    Jun 6, 2010 · What are the differences between the two data structures ArrayList and Vector, and where should you use each of them?

  2. Why is Java Vector (and Stack) class considered obsolete or deprecated?

    The fact that java.util.Stack extends java.util.Vector is a mistake in object-oriented design. Purists will note that it also offers a lot of methods beyond the operations traditionally associated with a stack …

  3. java - ArrayList vs Vector : Which one to use? - Stack Overflow

    Feb 27, 2014 · According to Java API: "it is recommended to use ArrayList in place of Vector" Still you can get a synchronized version of a List with Collections:

  4. Equivalent of std::vector in Java? - Stack Overflow

    Sep 16, 2010 · Can't a Java Vector be used instead of ArrayList? That would probably be ArrayDeque, if you need Stack functionality. Do not use the Stack class as other here suggest.

  5. java - convert vector to list - Stack Overflow

    Dec 29, 2009 · List<String> list = new Vector<String>(); (assuming a Vector of String s). If however you want to convert it to an ArrayList, which is the closest List implementation to a `Vector~ in the Java …

  6. How to have a vector of integers in Java - Stack Overflow

    Jun 21, 2013 · @clairharrison Don't use a Vector in Java to start with. I guess it can work, especially if you know C/C++. It is standard to use a ArrayList or LinkedList in Java.

  7. java - What function can be used to sort a Vector? - Stack Overflow

    5 According to the Java API Specification for the Vector class, it implements the List interface which is needed to use the Collections.sort method. Also, as a note, for most uses the Vector class could be …

  8. Vector.size() in Java - Stack Overflow

    Feb 3, 2016 · It got replaced in Java 1.2 back in 1998. See javadoc: "If a thread-safe implementation is not needed, it is recommended to use ArrayList in place of Vector." If you do need synchronization, …

  9. Use Hashtable, Vector or HashMap or ArrayList in Java

    Jan 17, 2009 · 14 One meme that gets stressed with Java development is always use ArrayList over Vector. Vector is deprecated. That may be true, but Vector and Hashtable have the advantage that …

  10. java - Convert HashMap key value (String) to Vector <String>? - Stack ...

    Apr 2, 2016 · List<String> productList = new ArrayList<>(hm.keySet()); 1Unless you're sharing this list with multiple threads, adding synchronization with a Vector is a cost.