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 the transient field modifier?
describe method overloading
what do you mean by classloader?
What one should take care of, while serializing the object?
How transient variable is different from volatile variable?
How many bytes is double?
Explain java coding standards for constants?
What is the difference between double and float variables in java?
What is a generic data type?
What steps are taken when the OS shifts from one-thread execution to another?
How to sort an array from smallest to largest java?
Can you explain the cs option of java interpreter?
What is size () in java?
What are use cases?
Write a program to show whether a graph is a tree or not using adjacency matrix.