I am trying to sort a char[] array in Java.
I tried using a List but it didn't work perfectly.
I also tried using Arrays.sort(dizimiz,String.case_insensive_order), but I got an error.
Here is the code I have:
Scanner sc=new Scanner(System.in);
System.out.println("Please enter text:");
String str=sc.nextLine();
// toCharArray() splits the string into a character array
char[] chars=str.toCharArray();
Arrays.sort(chars);
for (char c : chars) {
System.out.println(c);
}
What method can I use to do this?
UnicodeSet?