wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes ArrayList vs Vector 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 » Java » Beginning Java
Bookmark "ArrayList vs Vector" Watch "ArrayList vs Vector" New topic
Author

ArrayList vs Vector

Tyagi.Kapil Tyagi
Greenhorn

Joined: Jun 15, 2008
Posts: 4
Can anyone tell me any other difference between Vector and ArrayList
except Vector are synchronized and ArrayList are not,Vector belongs to the Legacy class and ArrayList is not.
except these answers can anyone suggest me any other answer.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14117
    
  16

Welcome to JavaRanch.

There's a historical reason why we have both Vector and ArrayList in the Java library. Vector is a legacy collection class from Java 1.0. ArrayList was introduced in Java 1.2 with the Collections Framework.

Vector was not removed from Java 1.2, because that would break many programs that people already had written before Java 1.2 came out.

Don't use Vector in any new code. If you really need a synchronized collection, then use Collections.synchronizedList(...):

See the API documentation for more information.

Note: This forum is about servlets, but your question is not about servlets. Please choose an appropriate forum when you ask a question. I'm moving this question to a more appropriate forum.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Tyagi.Kapil Tyagi
Greenhorn

Joined: Jun 15, 2008
Posts: 4
Thanks Sir,
I got it.
 
wood burning stoves
 
subject: ArrayList vs Vector