Why Arrays.sort(arr) is returning 0 values
<pre><code>import java.util.*;
import java.util.Arrays;
class stoner {

    public static void main(String[] args) 
    {
        Scanner ob = new Scanner(System.in);
        int t = ob.nextInt();
        int arr[] = new int[501];
        while(t-- &gt; 0)
        {
            int s = ob.nextInt();
            for(int i = 0;i&lt;s;i++)
            {
                arr[i] = ob.nextInt();
                Arrays.sort(arr);
            }
            for(int i = 0;i&lt;s;i++)
                System.out.print(arr[i]+" ");
        }
    }
}
</code></pre>

<p><strong>INPUT:</strong>
1(the test case)
5(size of array)
5 2 3 1 4 (the array elements)</p>

<p><strong>OUTPUT:</strong>
0 0 0 0 0</p>

<p>Why even after using this sort function we are getting 0's as answer???</p>