将字符串"wefdgpoqacb"中的字符,按降序排列,显示输出。
package homework;
import java.util.Arrays;
public class Nnmber {
public static void main(String[] args) {
String num="wefdgpoqacd";
char[] c=num.toCharArray();
Arrays.sort(c);
String s =new String(c);
StringBuffer sb=new StringBuffer(s);
sb.reverse();
System.out.println(sb);
}
}