Hi,i'm currently studyn d collections framework,bt i'm having trouble identifying when 2 use a linked list instead of a vector.is there much of a difference between them?are there any general guidelines as 2 which one is best 4 a given scenario?
See the topic Choosing an implementation from the Collections chapter of Eckel's Thinking in Java. (And note that it says, "Hashtable, Vector, and Stack ... are legacy classes, so that old code doesn't break. ...it�s best if you don't use those for new code." In general, use an ArrayList in place of a Vector.)
In comparing ArrayList to LinkedList, you will see (for example) that an ArrayList allows for fast random access, while a LinkedList allows for fast insertions and deletions from the middle.
Originally posted by Stan James: Wow, I like Eckell, but All those bold words make me bug eyed...
For what it's worth, his convention is...
...identifiers (method, variable, and class names) are set in bold. Most keywords are also set in bold, except for those keywords that are used so much that the bolding can become tedious, such as "class."
Hmmm... We certainly wouldn't want bolding to become "tedious." :roll: