?? strbuffer.java
字號:
//演示 StringBuffer 類方法的使用。
public class StrBuffer {
public static void main(String[] args) {
//自動產生的方法
StringBuffer s1 = new StringBuffer();
StringBuffer s2 = new StringBuffer(8);
StringBuffer s3 = new StringBuffer("StringBuffer");
System.out.println("s1 = new StringBuffer(),the capacity is--"+
s1.capacity());
System.out.println("s2 = new StringBuffer(8),the length is--"+
s2.length()+"\nThe capacity is --"+s2.capacity());
System.out.println("s3 = new StringBuffer(\"StringBuffer\")"+
"s3="+s3+" The length is--"+s3.length()+
"\nThe capacity is ---"+s3.capacity());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -