Array sort by Ascending in for loop
<p>I got trouble when i try to sort array in for loop.</p>

<p>I give you my code follow:</p>

<pre><code>public class Lottery {

    public Lottery() {
        java.util.Random iRandom = new java.util.Random();
        int num[] = new int[6];
        java.util.Arrays.sort(num);

        for(int i =0 ; i &lt; num.length; i++) {
            java.util.Arrays.sort(num);
            num[i] = iRandom.nextInt(49)+1;
            System.out.println(num[i]);
        }
    }

    public static void main(String[] args) {
        Lottery lott = new Lottery();
    }
}
</code></pre>

<p>In my above code, i can print random number for using "For Loop" but i try to sort it by ascending but it doesnt work.....</p>

<p>The way i do is right?</p>

<p>Could everybody can help me?</p>

<p>Thank you!</p>

<p>Best Regards!</p>
