Possible Duplicate:
How to convert List<Integer> to int[] in Java?
Is there some method to convert a Vector< Integer> to an int[]?
Thanks
Possible Duplicate:
How to convert List<Integer> to int[] in Java?
Is there some method to convert a Vector< Integer> to an int[]?
Thanks
 
    
     
    
    toArray() will do the conversion for you. Check the link for the javadoc of all the methods Vector has. This will be the boxed Integer, not int, but you can work from there.
 
    
    Vector uses objects and not primary types. so you can only convert to an Object[], to convert to a primary type array you'd have to use an additional step.
with no further comments on what's the point of your code, I would say that Integer[] would acomplish the same thing
 
    
    You can use a loop to copy a vector into an int[]
Vector<Integer> vector = ....
int count = 0, ints[] = new int[vector.size()];
for(int i: vector) ints[count++] = i;
