Hi All, I am not sure if this is the right forum to post this question. I know Vector is ThreadSafe but List is not. Can someone give me a realworld example on this ? I mean when to go for Vector and when to go for using List. It wll be really helpful if someone could give me some examples on the usage of ArrayList, Map, HashSet, HashTable etc. Thanks in advance Raj...
You can get example on all in any book (check out complete reference). Vector is not completely thread safe (if remember correctly). But you can make it (and all classes) as thread safe including (List interface and Vector class). And choice b/w List and Vector also depends upon requirement. There is one more imp. difference that is List stores elements in sequential order. regrads, Sanjeev.
(javadoc Unlike the new collection implementations, Vector is synchronized.
That's the most importing difference to Lists. But List is an interface, so you better compare a Vector to a LinkedList. Lists and vector both are sequences. But RTFM is a good idea though.