public static void main(String[] args) {
// 乱序的字符
char[] chars = {'a','c','u','b','e','p','f','z'};
// 用Arrays工具类正序排列,也可以用冒泡排序
Arrays.sort(chars);
StringBuffer sb = new StringBuffer(new String(chars));
// 顺序反转
sb.reverse();
// 处理结果数组
char[] c = new char[sb.length()];
sb.getChars(0, sb.length(), c, 0);
System.out.println(c);
}