Sunday, 15 January 2012
JAVA : Difference between Vector and ArrayList?
Do you like this Article?
Vector :
ArrayList :
- It's synchronized.
- It's slower than ArrayList.
- It's generally used in multithreading programs.
ArrayList :
- It's unsynchronized.
- It's faster than Vector.
- It's generally used in single-thread programs.
Subscribe to:
Post Comments
(
Atom
)
Popular Posts
-
public - public means everyone can access it.That means it's in global scope. As, main method is called by JVM [ Java Virtual Machine...
-
throw is used to throw an exception in a program, explicitly . Whereas, throws is included in the method's declaration part, wi...
-
Singleton in one of the most popular yet controversial design pattern, in the world of object oriented programming. It's one of t...
-
Web Container / Servlet Container / Servlet Engine : In J2EE Architecture , a web container (also known as servlet container or ser...
-
Program compiles. But at runtime throws an error “NoSuchMethodError”.
-
Vector : It's synchronized. It's slower than ArrayList. It's generally used in ...
-
doGet(): protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws ServletException, java.io.IOException – is a met...
-
In Java Programming Language , we must declare a variable name and type, before using it. The data type of a variable defines the th...
24 Responses to “ JAVA : Difference between Vector and ArrayList? ”
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
15 April 2012 at 04:44
Nicely written
15 April 2012 at 08:51
@Anonymous
Thanks a lot my friend!!
thanks for commenting!!
27 April 2012 at 00:07
ArrayList does allow null. Stop posting wrong information.
8 May 2012 at 10:44
Vector is a part of collection frame work please go the 1.3 documentation of Oracle.
10 September 2012 at 03:27
we can specify the increment size with the vector and with arraylist we can't.
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
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
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 )
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.
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
29 May 2019 at 11:03
Thanks for sharing this post.
Java Training with Placements
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.
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!
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
3 October 2023 at 05:03
Erzurum
Elazığ
Konya
Zonguldak
Eskişehir
ASV
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
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ı
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
1 September 2024 at 17:39
KYUJ,KLIKJL,
تسليك مجاري
3 September 2024 at 14:42
gjiluoiliolyujyjuu
شركة تسليك مجاري بالجبيل
5 November 2024 at 14:30
شركة عزل اسطح بالاحساء CbhejQbuKg
20 November 2024 at 18:33
شركة مكافحة حشرات بالهفوف juyKO2gtS1
1 December 2024 at 19:23
شركة عزل اسطح بالقطيف KzJIeeegXb
Post a Comment