java中123456如何排序成654321

2024-11-27 16:38:04
推荐回答(1个)
回答1:

StringBuffer sb = new StringBuffe("123456");
System.out.println(sb.reverse().toString);