This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Well, if you're referring to the classes java.util.Vector and java.util.ArrayList, the difference is pretty simple. A Vector is thread-safe, while an ArrayList is not. That means that, if multiple threads are sharing data in a Vector, your data will be fine but, if they're sharing data in an ArrayList, you could have data integrity issues. Of course, this extra safety comes at a price. Vectors are slower than ArrayLists. If you're not sharing data among threads, use an ArrayList, otherwise, use a Vector. Functionally, they're almost identical. I hope that helps, Corey
If you mean arrays and Vectors, the difference is that the size of an array must be allocated prior to use and can not be exapanded. Arrays are much more efficient that Vectors (or any Collection object) and should always be the first choice if possible.
In addition, simple arrays can contain any Java data type, including other arrays. Containers, such as Vectors or ArrayLists can only contain objects (reference variables). You can't have an ArrayList of primitives. Of course, you can have an ArrayList of arrays. Corey