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
What is get () in java?
What super () does in java?
If goto and const is reserve words than why it is not work in java?
What data structures are used to perform recursion?
What is the major advantage of external iteration over internal iteration?
Is void a data type in java?
Is java se free?
Explain exception chaining in java?
do I need to use synchronized on setvalue(int)? : Java thread
How are java objects passed to a method and what are native methods?
What is a key in java?
Explain the differences between abstraction and encapsulation?
What data type is a string?
Explain static nested classes ?
What is complexity and its types?