Re: Question on vector in java - some1 help
Vector is still included in new versions of Java for backwards compatibility with code written with older (pre-1.2) versions. New code should use ArrayList, which is essentially the same thing with a few improvements. The biggest difference is that ArrayList is not synchronized, while Vector is, resulting in a performance improvement when you don't need synchronization.
If you do need a synchronized ArrayList, you can do the following:
List list = Collections.synchronizedList(new ArrayList(...));
Craig
spamcloud.org
|