package
javaprgms;
import
java.util.Arrays;
public class
SortString {
public static void main(String[] args) {
String original = "edcba";
char[] chars = original.toCharArray();
Arrays.sort(chars);
String sorted = new String(chars);
System.out.println(sorted);
}
}
Output:
abcde
No comments:
Post a Comment