I'm working on this program where I create an array of random integers and use bubble sort to get them in order:
package bubblesort; import java.util.Random; public class BubbleSort { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here final int size = 10; int[] array = new int[size]; Random randomNumber = new Random(); for(int i=0; i<array.length; i++){ array[i] = randomNumber.nextInt(29); } int[] sortedArray = bubbleSort(array); System.out.println(sortedArray); } static int[] bubbleSort(int[] numbers){ int n = numbers.length; for(int pass=1; pass<=n; pass++){ for(int current=0; current<n-pass; current++){ if(numbers[current] > numbers[current+1]){ //swap int temp = numbers[current]; numbers[current] = numbers[current+1]; numbers[current+1] = temp; } } } return numbers; } }
instead of it outputting the sorted numbers I get an output of: [I@4669b7fe
any thoughts?