String in ascending order
package com.demo;
public class StringAscending {
public static void main(String[] args) {
String[] names = {"namratha","anita","asher","heena","jagruthi"};
String str = "this is my new string";
char[] content = str.toCharArray();
java.util.Arrays.sort(content);
String sorted = new String(content);
System.out.println(content);
}
}
No comments:
Post a Comment