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 return code?
What is the difference between final, finally and finalize()?
What is final modifier?
Is zero a natural number?
Is int a class in java?
Is string is a data type in java?
What is the name of the java compiler?
What is floating data type?
What is "this" keyword in java? Explain
Which is better stringbuffer or stringbuilder?
What is the use of predicate in java 8?
What is meant by flickering?
How do you use parseint in java?
Why set do not allow duplicates in java?
What is proper subset?