assign object to type that is unknown until runtime
<p>I am trying to write a method that will take in an array and return another array of the same type, double the size and with the same contents.  However I need a way of assigning the array type to something that will not be known until runtime. example:</p>

<pre><code>public object[] doubleArray(object[] array) {
---[] arrayCopy = new ---[array.length*2];
//copy content
for (int i = 0; i &lt; array.length; i++) {
        arrayCopy[i] = array[i];
}
return arrayCopy;
}
</code></pre>

<p>The array passed in will not be known until runtime.
Thanks any help will be greatly appreciated</p>

<p>PS I realise that managing of array sizes can be done with ArrayLists etc but for this purposes it would be great to keep things to arrays.</p>
