Java Selection Sort implementation not working output "[I@15db9742" : <p>Hey I'm trying to test my selection sort algorithm but all the output I get in the console is just "[I@15db9742"
Could someone please explain to me why I'm getting junk output? It is really baffling me, could it possible be a problem with the IDE or is it something in the code? </p>

<p>Thanks</p>

<pre><code>import java.util.Arrays;


public class SelectionSorterTest {

    // Factories

    // Queries

    /**
     * Sorts a copy of the input array.
     * @param input an array.
     * @return a sorted copy of input.
     */
    public static int[] sort (int[] input) {
        int[] sorted = Arrays.copyOf(input, input.length);
        for(int i = 0; i &lt; sorted.length - 1; i++)
        {
            int minIndex = i;
            for(int j = i + 1; j &lt; sorted.length - 1; j++)
            {
                if(sorted[j] &lt; sorted[minIndex])
                {
                    minIndex = j;
                }
            }
            if(i != minIndex)
            {
                swap(sorted, minIndex, i);
            }
        }
        return sorted;
    }


    // Commands

    // Private

    // disabled constructor
    private SelectionSorterTest () { }

    private static void swap (int[] arr, int x, int y) {
        int temp = arr[x];
        arr[x] = arr[y];
        arr[y] = temp;
    }

    public static void main(String[] args)
    {
        int[] Array = {9,7,6,4,3,2,21,1};
        System.out.println(sort(Array));

    }

}
</code></pre>
