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
What is the use of parseint in java?
Why Java doesn’t support multiple inheritance?
Explain the significance of class loaders in bootstrap?
Can list have duplicates in java?
What does += mean in java?
Which non-unicode letter characters may be used as the first character of an identifier?
What are 3 boolean operators?
What is a short in java?
What is nullpointerexception?
What mechanism does java use for memory management?
What's the base class of all exception classes?
What is static keyword?
Explain static nested classes ?
How does remove work in java?
What is a boolean structure?