what is the diff b/w arraylist and vector?
Answer Posted / umanath
Vector and ArrayList are very similar. Both of them
represent a 'growable array',
ArrayList it's part of the Java Collection Framework, and
has been added with version 1.2, Vector it's an object that
is present since the first version of the JDK.
The main difference is that Vector it's a synchronized
object, while ArrayList it's not.
While the iterator that are returned by both classes are
fail-fast (they cleanly thrown a
ConcurrentModificationException when the original object has
been modified), the Enumeration returned by Vector are not.
Unless you have strong reason to use a Vector, the
suggestion is to use the ArrayList.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain about the select method with an example?
Can we access instance variables within static methods ?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
Write a code to create a trigger to call a stored procedure
What is an exception? difference between Checked and Unchecked exception in Java
Can we override private method in java?
What is a data structure java?
What is array length?
What is the exact difference in between Unicast and Multicast object?
What is re-factoring in software?
Why java is not 100% object-oriented?
How are java objects passed to a method and what are native methods?
What is this () in java?
What is the difference between delete and delete[]
What is byte code and why is it important to java’s use for internet programming?