How to convert an Integer Vector to int array
807605Jun 24 2007 — edited Jun 25 2007I need an int[] array for which I do not know the length at compilation time.
So I am using a Vector vector = new Vector(), the elements of which I define as of type Integer.
However, I have a method which calls an int[] array and not a Vector.
How can I convert my vector to an int[] array?
I cannot just use vector.toArray(), because this makes an Object[] array, out of which I can make an Integer[] array, but not an int[] array.
How can I make an int[] array?
Thanks for looking at this!