String+=?
程序员文章站
2022-04-22 20:28:00
...
源代码:
public class Main {
public static void main(String args[]){
String a="a"+"b"+"c";
a+="d";
a+="e";
System.out.println(a);
}
}
编译后:
import java.io.PrintStream;
public class Main
{
public Main()
{
}
public static transient void main(String args[])
{
String a = "abc";
a = (new StringBuilder(String.valueOf(a))).append("d").toString();
a = (new StringBuilder(String.valueOf(a))).append("e").toString();
System.out.println(a);
}
}
上一篇: 总结关于设计小技巧注意点
推荐阅读