If all elements are the same type, it is easier to work with an array of that specific type.
import java.util.Vector; public class MainClass { public static void main(String args[]) { Vector v1 = new Vector(); v1.add("A"); v1.add("B"); v1.add("C"); String array[] = new String[0]; array = (String[]) v1.toArray(array); for (int i = 0; i < array.length; i++) { System.out.println(array[i]); } } }
A B C