Hello,
Unless you do want to maintain compatibility with older JVM (below version 1.2) is preferable to use the collection framework even in a multi-threaded application:
Code:
List lst = Collections.synchronizedList ( new ArrayList() );
Map mp = Collections.synchronizedMap ( new HashMap() );
But a Vector (ArrayList) corresponds to a Java array, then indexed by integers, which should be faster I think. Quite agree! It may be better for you to tell us what you gonna do. By cons, there is not much of interest to compare the List and Map.
Bookmarks