public class ArrayBubbleSort { public static void main(String[] args) { int [] nums = {77, 88, 99, 64, 22, 92, 65, 2, 61, 16, 76, 3, 5, 89, 95, 70, 21, 25, 81, 91, 88, 51, 31, 64, 86}; bubbleSort(nums); output(nums); } public static void bubbleSort(int[] n) { for(int x = 0; x < n.length - 1; x++) { for(int y = 0; y < n.length - 1; y++) { if(n[y] > n[y+1]) { int temp = n[y]; n[y]=n[y+1]; n[y+1] = temp; } } } } public static void output(int [] n) { for(int x = 0; x < n.length - 1; x++) { System.out.print(n[x] + " "); } } }