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


Please Help Members By Posting Answers For Below Questions

Can we sort array in java?

525


How does list work in java?

501


What is the exact difference in between Unicast and Multicast object?

1502


What data type is string java?

530


What are loops in java? What are three types of loops?

545






What is difference between word and integer?

588


What is equals method in java?

520


What are the high-level thread states in java programming?

581


What is consumer in java?

520


Explain when classnotfoundexception will be raised ?

563


How do you create an array in java?

529


Is empty string in java?

534


What is array and arraylist in java?

525


When should I use a singleton?

552


How do you sort in ascending order in java?

516