Reversing an Array
<p>I wrote code to reverse an integer array. Code is as shown below:</p>

<pre><code>public class ReverseArray {

    public static void main(String[] args) {
        try {
            int[] arr = new int[5];
            arr[0] = 1;
            arr[1] = 2;
            arr[2] = 3;
            arr[3] = 4;
            arr[4] = 5;
            for (int i = 0; i &lt;= arr.length/2; i++)
                int temp = arr[0];
                arr[0] = arr[arr.length - i - 1];
                arr[arr.length - i - 1] = temp;
            }
            System.out.println(arr);

        } catch (Exception e) {
            System.out.println(e);
        }
    }
}
</code></pre>

<p>But it's not reversing the array.. I'm getting following output.</p>

<pre><code> [I@3bad086a
</code></pre>

<p>I don't see anything wrong with my logic.</p>
