• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Collections ques

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

What is the diff b/w ArrayList and Vector (apart from Vector being Synchronized).
Also plz explain in brief what is LinkedList

Regards

Nikhil
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to Bruce Eckel, "Vector is generally not as fast as ArrayList, and it should be avoided; it�s only in the library for legacy code support..." (Reference with more details here.)

In a LinkedList, each element has a reference (link) to the next element (and sometimes the previous element as well). This allows for fast insertions and deletions from the middle of the list, because all that needs to change is a given element's reference, instead of reindexing ("moving") all the other elements after it. On the other hand, there is no random access in a LinkedList, because you need to sequence through the elements (links) to find a particular element.

Also see Wikipedia: Linked List.
[ March 23, 2006: Message edited by: marc weber ]
reply
    Bookmark Topic Watch Topic
  • New Topic