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
How to display arraylist values in java?
Does java runtime require a license?
What do you mean by hashing?
What is the meaning of 3 dots in java?
When do we need to use internal iteration? When do we need to use external iteration?
What are loops in java?
How to run a JAR file through command prompt?
What is the difference between static (class) method and instance method?
Describe the Big-O Notation.
What is java object name?
What are the two types of exceptions in java? Which are the differences between them?
Why is sizeof not a function?
How to implement a multithreaded applet?
Give me an example of array and linked list? Where they can be used?
What do you understand by abstract classes?