What is the difference between Array list and vector in Java?

420 views 2 replies

anyone please provide deep information

Replies (2)

ArrayList and Vector both implements List interface and maintains insertion order.

However, there are many differences between ArrayList and Vector classes that are given below.

ArrayList Vector
1) ArrayList is not synchronized. Vector is synchronized.
2) ArrayList increments 50% of current array size if the number of elements exceeds from its capacity. Vector increments 100% means doubles the array size if the total number of elements exceeds than its capacity.
3) ArrayList is not a legacy class. It is introduced in JDK 1.2. Vector is a legacy class.
4) ArrayList is fast because it is non-synchronized. Vector is slow because it is synchronized, i.e., in a multithreading environment, it holds the other threads in runnable or non-runnable state until current thread releases the lock of the object.
5) ArrayList uses the Iterator interface to traverse the elements. A Vector can use the Iterator interface or Enumeration interface to traverse the elements.

If it is not against the community guidelines I would suggest some links regarding this,

https://www.javatpoint.com/difference-between-arraylist-and-vector

https://www.geeksforgeeks.org/vector-vs-arraylist-java/

I hope this will work for you.

 

Thanks & Regards

Seema

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register  

Company
ARTICLESHIP 11 July 2026
Article

SNCO

Mumbai

CA Inter

View Details
Company
25 June 2026
Accounts & Taxation Executive

Dindukurthy & Associates

Hyderabad

MBA

View Details
Company
ARTICLESHIP 16 July 2026
Article Assistant

G A R U D & Associates

New Delhi

CA Inter

View Details
Company
Featured 18 July 2026
Senior Manager- Finance & Accounts

apricus india

Ahmedabad

CA

View Details
Company
14 July 2026
Senior Executive/ Manager

H S SHARMA AND CO

Pune

CA Final

View Details
Company
22 June 2026
Finance Manager- Chartered Accountant

Triveni Turbine Limited

Bengaluru

CA

View Details
Company
ARTICLESHIP 30 June 2026
Article Assistant or Paid Assistant

VIKAS VERMA & CO

New Delhi

Others

View Details
Company
Featured 24 June 2026
HEAD - AUDIT AND TAXATION

A R JADHAV AND ASSOCIATES

Mumbai

CA Inter

View Details