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 the purpose of static methods and variables?
What is command line argument
What do you know about the garbate collector?
Explain the significance of listiterator.
What is java in detail?
What are reference variables in java?
Explain java code for recursive solution's base case?
What are the types of literals?
What is executor memory?
Is string a wrapper class?
Explain implementation and how is it different from conversion?
Why unicode is important?
Why inputstreamreader is used in java?
What do you mean by byte code?
Can a class be a super class and a sub-class at the same time? Give example.