Hey.
I have this method that, when used, should put order to the array that i have and then i should be able to call it from main and print it from there. However i cannot seem to get anything right out from it.
I always get "[I@7d4991ad" as a print back..
I am calling it like this in my main:
System.out.println(sortt(arr));
And this is the method:
private static int[] sortt(int[] arr) { int toSwap, indexOfSmallest = 0; int i, j, smallest; for (i = 0; i < arr.length; i++) { smallest = Integer.MAX_VALUE; for (j = i; j < arr.length; j++) { if (arr[j] < smallest) { smallest = arr[j]; indexOfSmallest = j; } } toSwap = arr[i]; arr[i] = smallest; arr[indexOfSmallest] = toSwap; } return arr; }