To sort the numbers using java
<pre><code>class sort {
    public static void main(String args[]) {
        int arr[], i, j, n, temp;
        n = args.length;
        for (i = 0; i &lt;n; i++) {
            arr[i] = Integer.parseInt(args[i]);
        }
        for (i = 0; i &lt; n-1; i++) {
            for (j = i + 1; j &lt; n; j++) {
                if (arr[i] &gt; arr[j]) {
                    temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
        for (i = 0; i &lt;= n; i++) {
            System.out.println(arr[i]);
        }
    }
}
</code></pre>

<p>I found some error in my program please check it out. some error in arr[] is coming but i am not able to find the actual problem</p>
