标签:int out pen str 运行 sys eve style system
StringBuffer的替换功能:
/* * StringBuffer的反转功能: * public StringBuffer reverse() */
代码实现案例:
public class StringBufferDemo { public static void main(String[] args) { //创建缓冲区对象 StringBuffer buffer = new StringBuffer(); //添加数据 buffer.append("hello"); System.out.println("buffer:"+buffer); // public StringBuffer reverse() buffer.reverse(); System.out.println("buffer:"+buffer); } }
运行结果:
buffer:hello
buffer:olleh
标签:int out pen str 运行 sys eve style system
原文地址:https://www.cnblogs.com/hanlu0516/p/10919520.html