what is the difference between ArrayList and Vector
Answer Posted / m.sridhar
ArrayList and vector both are dynamically growing arrays.
ArrayList is not thread safe where as vector is thread safe.
vector is legacy class and ArrayList is newly added.
by default ArrayList capacity is 0 where as Vector intial
capacity is 10.
vector is growing by its size doubled.
ArrayList is increse by its size half(50%)
Is This Answer Correct ? | 47 Yes | 6 No |
Post New Answer View All Answers
Can we sort array in java?
How does list work in java?
What is the exact difference in between Unicast and Multicast object?
What data type is string java?
What are loops in java? What are three types of loops?
What is difference between word and integer?
What is equals method in java?
What are the high-level thread states in java programming?
What is consumer in java?
Explain when classnotfoundexception will be raised ?
How do you create an array in java?
Is empty string in java?
What is array and arraylist in java?
When should I use a singleton?
How do you sort in ascending order in java?