Back to Top

Sunday, 15 January 2012

JAVA : Difference between Vector and ArrayList?

Vector :
  1.               It's synchronized.
  2.               It's slower than ArrayList.
  3.               It's generally used in multithreading programs.

ArrayList :
  1.               It's unsynchronized.
  2.               It's faster than Vector.
  3.               It's generally used in single-thread programs.





24 Responses to “ JAVA : Difference between Vector and ArrayList? ”

chmod examples unix said...
28 March 2012 at 09:38

Good differences, nicely put in point format. another one is that vector was not member of collection framework prior to JDK 1.4 and later retrofitted into Collection API. see here for more differences between Vector and ArrayList


Anonymous said...
15 April 2012 at 04:44

Nicely written


Anijit Sarkar said...
15 April 2012 at 08:51

@Anonymous
Thanks a lot my friend!!
thanks for commenting!!


Anonymous said...
27 April 2012 at 00:07

ArrayList does allow null. Stop posting wrong information.


Anonymous said...
8 May 2012 at 10:44

Vector is a part of collection frame work please go the 1.3 documentation of Oracle.


kuldeep said...
10 September 2012 at 03:27

we can specify the increment size with the vector and with arraylist we can't.


Hashtable vs HashMap said...
27 September 2012 at 10:11

One more difference between ArrayList vs Vector is that later is a legacy class and initially not part of Collection API


Anonymous said...
1 July 2014 at 15:20

vector:
It is introduced in java 1.2
It is thread safe
ArrayList:
It is introduced in java 1.5
It is not thread safe


Arunava Saha said...
17 July 2014 at 10:04

One more -
Arraylist is more memory effective than vector because of the difference between their load factor.
Explanation:
Load Factor of Vector is 2 * old_value, means if a vector is sized 10 and it needs to re-size then it will be re-sized to 20 (2 * 10).
whereas load factor of ArrayList is (3 * old_value) / 2 + 1, means if an arraylist is sized 10 and needs to re-size then it will be re-sized to 16 ( (3*10) / 2 + 1 )


Vikas said...
13 June 2015 at 22:11

There is one more option instead of vector, synchronized ArrayList, its better because Vector is too old and can be deprecated.


Unknown said...
28 July 2018 at 17:21

uperb explanation & it's too clear to understand the concept as well, keep sharing admin with some updated information with right examples.Keep update more posts.java training


Venkatesh CS said...
29 May 2019 at 11:03

Thanks for sharing this post.
Java Training with Placements


Anonymous said...
19 April 2020 at 19:36

Thanks for sharing the information between vector and arraylist, I want to Hire Java Developers for my newly settled organization. This difference will help during the interview of any developer's.


taranstech said...
14 October 2021 at 17:17

This blog is so cool. I am learning Java Training online. This blogs helps me find out better understanding about salesforce training. Thank you for this blog!


Priya Gupta said...
29 December 2021 at 12:19

Such a great blog! I am looking for these kinds of blogs for last many days. Keep it up. Thanks for sharing it with us
Best online Coaching app
Best online teaching apps


NeonCyberSorcerer said...
3 October 2023 at 05:03

Erzurum
Elazığ
Konya
Zonguldak
Eskişehir
ASV


AstralVoyager1Q234 said...
20 October 2023 at 11:51

bartın evden eve nakliyat
bitlis evden eve nakliyat
diyarbakır evden eve nakliyat
kars evden eve nakliyat
nevşehir evden eve nakliyat
VW6A


79119Maksim21393 said...
11 November 2023 at 00:20

3A657
Antalya Evden Eve Nakliyat
Düzce Şehirler Arası Nakliyat
Erzurum Şehir İçi Nakliyat
Çerkezköy Petek Temizleme
Karabük Lojistik
Çankaya Parke Ustası
Isparta Şehir İçi Nakliyat
Afyon Evden Eve Nakliyat
Ünye Fayans Ustası


7B169Lawrence7E564 said...
11 November 2023 at 14:28

E804D
Kars Evden Eve Nakliyat
Ordu Şehir İçi Nakliyat
Çerkezköy Çekici
İzmir Şehirler Arası Nakliyat
Balıkesir Lojistik
Paribu Güvenilir mi
Bayburt Şehirler Arası Nakliyat
Yenimahalle Boya Ustası
Maraş Şehir İçi Nakliyat


Anonymous said...
1 September 2024 at 17:39

KYUJ,KLIKJL,
تسليك مجاري


Anonymous said...
3 September 2024 at 14:42

gjiluoiliolyujyjuu
شركة تسليك مجاري بالجبيل


Anonymous said...
5 November 2024 at 14:30

شركة عزل اسطح بالاحساء CbhejQbuKg


Anonymous said...
20 November 2024 at 18:33

شركة مكافحة حشرات بالهفوف juyKO2gtS1


Anonymous said...
1 December 2024 at 19:23

شركة عزل اسطح بالقطيف KzJIeeegXb


Post a Comment

Popular Posts

Subscribe via Email
Subscribe Java Interview Questions via Email
All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar