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 skeleton and stub?
How many threads does a core java have?
How do you include a string in java?
Mention the default values of all the elements of an array defined as an instance variable.
What are the properties of thread?
What is methodological theory?
How do you convert boolean to boolean?
Which is dependent variable?
What is a function in programming?
How does singleton class work?
How do constructors use this() and super()?
What is foreach loop in java?
What is the purpose of a volatile variable?
Why are lists ordered in java?
What is immutable in java?