jQuery in Action, 2nd edition*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes dif between vector() and ArrayList() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "dif between vector() and ArrayList()" Watch "dif between vector() and ArrayList()" New topic
Author

dif between vector() and ArrayList()

santosh gunake
Greenhorn

Joined: May 20, 2006
Posts: 6
is there any difference between vector and arraylist other than synchronization
Arno Reper
Ranch Hand

Joined: Mar 14, 2006
Posts: 286
when you use vector its soooo slowly...but its because of the synchronized method, that 's why vector is deprecated...and you beter use arraylist who has the same possiblities

arno


The man who makes no mistakes does not usually make anything<br /> <br />>>> SCJP 5.0 >> SCJD B&S <<< In progress
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
One more difference is in terms of growth of the collection

ArrayList increases its size by 50%.

Whereas, Vector increases its size by 200%.

regards

Naseem Khan
[ May 20, 2006: Message edited by: Naseem Khan ]

Asking Smart Questions FAQ - How To Put Your Code In Code Tags
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
Vector or ArrayList -- which is better
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: dif between vector() and ArrayList()