They are for integers, but they still show how the basic of a Bubble Sort works.
public static void bubleSort(String[] ar) {
int n = ar.length;
for (int pass = 1; pass < n; pass++) {
for (int i = 0; i < n - pass; i++) {
if (ar[i].compareTo(ar[i + 1]) > 0) {
String tmp = ar[i];
ar[i] = ar[i + 1];
ar[i + 1] = tmp;
}
}
}
}