Why am I getting a weird answer while trying to reverse elements of an array?
<p>I am new to Java programming. So i tried to reverse the elements of an array using the code shown in the image. But I am getting a completely different kind of answer. Please help me out!
 <a href="http://i.stack.imgur.com/CQCyJ.jpg" rel="nofollow">http://i.stack.imgur.com/CQCyJ.jpg</a></p>

<pre><code>    public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] arr = {1,3,4,6};
        int[] arr2 = new int[4];
        for (int k = 0; k&lt;4; k++){
            arr2[4-(k+1)] = arr[k];
        }
        System.out.println(arr2);
        in.close();
    }
</code></pre>

<p>}</p>