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 different forms of polymorphism?
Is java an open source?
What do you understand by the term polymorphism?
Can size_t be negative?
Which class is used by server applications to obtain a port and listen for client requests?
What is binary search in java?
Can a class be private or protected in java?
How is a variable stored in memory?
How do you include a string in java?
Should you use singleton pattern?
What are features of java?
What is the range of the short type?
How do you trim a space in java?
What are aggregate functions explain with examples?
Where are the card layouts used?