To sort a string, we first need to convert it into a character array
The Arrays.sort() method is a void method and does not return a value. it sorts the array in place.
Finally, we need to convert the sorted character array back into a string
We can sort a string using sorted() without converting it to a character array.
However, we still need to use ''.join() to obtain a sorted string because sorted() returns a list
C++ std::sort() works directly on a std::string without needing to convert it to a character array, because a std::string in C++ is essentially a sequence of characters (similar to a char array)