Java经典实例:按字符颠倒字符串时间:2023-03-10 00:08:53 使用StringBuilder类的reverse()方法来实现。 /** * Created by Frank */ public class StringRevChar { public static void main(String[] args) { String sh = "ABCDEFG"; System.out.println(sh + "->" + new StringBuilder(sh).reverse()); } }