[b]比較string、stringbuffer、stringbuilder拼接效率[/b]
輸出結果:
Start... 30000
用String+=拼接字元串的時間32800
用String=String+拼接字元串的時間30609
用String.concat拼接字元串的時間14144
用StringBuffer.append拼接字元串的時間2
用StringBuilder.append拼接字元串的時間2
End...
[b]比較string、stringbuffer、stringbuilder拼接效率[/b]
輸出結果:
Start... 30000
用String+=拼接字元串的時間32800
用String=String+拼接字元串的時間30609
用String.concat拼接字元串的時間14144
用StringBuffer.append拼接字元串的時間2
用StringBuilder.append拼接字元串的時間2
End...