for (int i = 0; i < arr.length - 1; i++) {
for (int j = 0; j < arr.length - (i + 1); j++) {
if (Integer.parseInt(arr[j]) > Integer.parseInt(arr[j+1])) {
String temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
StringBuffer sb = new StringBuffer();
for (int i = 0; i < arr.length; i++) {
if (i != arr.length -1) {
sb.append(arr[i]).append(" ");
}else {
sb.append(arr[i]);
}
}