提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
如何使用Java StringBuffer类的reverse方法反转StringBuffer的内容。
/** 时代Java 提供 **/ public class Main { public static void main(String[] args) { StringBuffer sb = new StringBuffer("Java StringBuffer Reverse Example"); System.out.println("Original StringBuffer Content : " + sb); //To reverse the content of the StringBuffer use reverse method sb.reverse(); System.out.println("Reversed StringBuffer Content : " + sb); } }