java how to initialize a vector
Best Answer: Use the following code to initialize a vector with bunch of values. Starting with Java5, you 'type' the Vector. Vector is synchronized, meaning you can have a performance hit. ArrayList<Integer> is a better choice. What the angle brackets do is make your collection type safe. Note the cap 'I' in Integer, that makes it an Object, thus you gain methods such as compareTo(); You will have to manually load the ArrayList...