2.7.6 字符串连接符

“+”运算符两侧的操作数中只要有一个是字符串(String)类型,系统会自动将另一个操作数转换为字符串然后再进行连接。

【示例2-24】 连接符“+”

 int a=12;
 System.out.println("a="+a);//输出结果: a=12