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

Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

663


Can we create more than one object singleton class?

596


What is string value?

646


Can we use static class instead of singleton?

590


Can a top level class be private or protected?

580






Why singleton pattern is better than creating singleton class with static instance?

544


How to implement a multithreaded applet?

2212


Is map ordered in java?

539


What are the benefits of operations in java?

499


Write a program to check string is palindrome without using loop?

577


Why put method is used?

541


What is a stack class in java ?

618


What is bufferedwriter?

549


What is a boolean output?

534


How do you add an element to an arraylist in java?

496