1 public class BubblesSort {
2 public static void main(String[] args) {
3 int array[] = { -1, 10, 3, 27, 15, 8 };
4 for (int i = 0; i < array.length - 1; i++) {
5 for (int j = 0; j < array.length - i - 1; j++) {
6 if (array[j] > array[j + 1]) {
7 int temp = array[j];
8 array[j] = array[j + 1];
9 array[j + 1] = temp;
10 }
11 }
12 }
13 for (int i = 0; i < array.length; i++) {
14 System.out.println(array[i]);
15 }
16 }
17 }