what is the difference between the ArrayList and Vector?
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
They are all collections that implements List,can anybody tell me the difference between them,thanks in advance!
------------------
------------------
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Vector is Thread-safe ArrayList !
Om
Om
william shen
Ranch Hand
Posts: 60
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
but I did not find any synchronized method in Vector's API document.ple clear me up! Thanks a lot!
------------------
Originally posted by Om Sonie:
Vector is Thread-safe ArrayList !
Om
------------------
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Does this help? (from Java api spec):
As of the Java 2 platform v1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized.
I can only guess that methods that perform structural modifications to the Vector are synchronized (although they are not shown to be in the api spec).
[This message has been edited by Tod Tryk (edited June 11, 2001).]
As of the Java 2 platform v1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized.
I can only guess that methods that perform structural modifications to the Vector are synchronized (although they are not shown to be in the api spec).
[This message has been edited by Tod Tryk (edited June 11, 2001).]
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
If you look at the actual source for the Vector class you will see that all the methods that touch the array in the Vector are synchronized.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
william shen
Ranch Hand
Posts: 60
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Thank you all! These are really helpful!
------------------
------------------
| look! it's a bird! it's a plane! It's .... a teeny tiny ad Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |






