How to assign array values at run time
<p>Consider I have an Array,</p>

<pre><code>int[] i = {1,2,3,4,5};
</code></pre>

<p>Here I have assigned values for it. But in my problem I get these values only at runtime.
How can I assign them to an array.</p>

<p>For example:</p>

<p>I get the max size of array from user and the values to them now how do I assign them to the array int [].</p>

<p>Or can I use anyother data types like ArrayList etc which I can cast to Int[] at the end?</p>
