what is the difference between ArrayList and Vector
Answer Posted / janardhan
ArrayList contains all methods are non-synchronized methods.
ArrayList by default not threadsafe.
ArrayList allows duplicate objects.
ArrayList default size is 16.if you want to increase size
use this formula:-- defaultsize * 3/2 + 1.
we can make araylist as synchronised:--
List l=Collections.SynchronizedList(new arrayList());
Arraylist is best choice for retrival operation and worest
choice for insert operation.
Vector:--
Vector is same like arraylist, but we have only one
difference is vector contains all synchronized methods.
Vector is best choice for retrival operation and worest
choice for insert operation.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is string passed by reference in java?
what is object-oriented programming in java?
Is string is a data type in java?
What is jvm? How its run?
What does main method?
What is the meaning of immutable regarding string?
Why are the destructors for base class and derived class called in reverse order when the program exits
How do you avoid global variables?
List any five features of java?
Can we serialize arraylist in java?
What is one third plus one third as a fraction?
Can you access non static variable in static context?
Can we create an object of static class in java?
Which collection is sorted in java?
What are the main uses of java?