[Java 教學範例拷貝]- StringBuilder 類別
[Java 教學範例拷貝]- StringBuilder 類別
剛才找資料時發現一個的Java 教學網站,趕快發揮(C/P)的長才將它備份來,有需要的同好,歡迎來(C/P)一下^^。
拷貝來源:
http://openhome.cc/Gossip/JavaGossip-V1/
http://openhome.cc/Gossip/JavaGossip-V1/StringBuilder.htm
public class UseStringBuilder {
public static void main(String[] args) {
StringBuilder strBuilder =
new StringBuilder("Knowledge is power!");
System.out.println("內容: " + strBuilder);
System.out.println("長度: " + strBuilder.length());
System.out.println("容量: " + strBuilder.capacity());
}
}
|