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 are synchronized methods and synchronized statements in java programming?
What does business logic mean?
How many bits is a float?
What is multithreading and its advantages?
What is n in java?
What is the difference between preparedstatement and statement in java?
What is a numeric string?
What are structs in java?
Define an applet in java?
What is type conversion in java?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
What is flag in java?
How does queue work in java?
Do I need java on my computer?
What is the primitive type short?