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

What is immutability in java?

800


Can we override private method?

793


What is character in data type?

732


In the below example, how many string objects are created?

770


How many types of threads are there in java?

736


What is ph and buffers?

724


Write a code to create a trigger to call a stored procedure

724


What are the types of inner classes (non-static nested class) used in java?

794


In java, how we can disallow serialization of variables?

729


What language is an assembler written in?

746


what is static import in java? Explain

770


Can we change the value of static variable?

691


Which class is used by server applications to obtain a port and listen for client requests?

701


What is the purpose of the system class in java programming?

741


Are strings immutable in java?

723