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 java code slower than native code?
What is java developer skills?
Define inheritance?
Does A Class Inherit The Constructors Of Its Superclass?
How dead lock situation occurs in java and how you can identify it?
Explain public static void main(string args[]).
explain multi-threading in java?
What is the use of volatile in java?
How do you compare objects in java?
Explain garbage collection in java?
Difference between stack and queue?
Is null or empty java?
What is the formula to calculate percentage?
What is comparable and comparator interface? List their differences
Which is better ascii or unicode?