2016年4月21日

String StringBuffer StringBuild作为参数传递

摘要: public static void main(String[] args) { String s1 = "hello"; String s2 = "world"; System.out.println(s1 + " " + s2);// hello world change(s1, s2); Sy 阅读全文

posted @ 2016-04-21 17:29 java外行 阅读(379) 评论(0) 推荐(0) 编辑

StringBuffer的构造方法和capacity的返回值关系

摘要: 1、空参构造 new StringBuffer(); 默认分配的初始化缓冲区的大小是16 源码: public StringBuffer() { super(16); } 2、new StringBuffer(int capacity); 默认初始化缓冲区大小是其传入的值的大小 源码: public 阅读全文

posted @ 2016-04-21 10:04 java外行 阅读(702) 评论(0) 推荐(0) 编辑

导航