
Sir, give me a Java program to read data from keyboard up to names , sort in alphabetical order using bubble sort

hi friend,
Try the following code
class BubbleSortString {
public static void main(String args[]) {
String name = args[0];
String arr[] = name.split("");
for (int j = 0; j < arr.length; j++) {
for (int i = j + 1; i < arr.length; i++) {
if (arr[i].compareTo(arr[j]) < 0) {
String t = arr[j];
arr[j] = arr[i];
arr[i] = t;
}
}
System.out.print(arr[j]);
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.