• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ArrayList vs Vector

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tyagi.Kapil Tyagi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sir,
I got it.
reply
    Bookmark Topic Watch Topic
  • New Topic