+ 两边是数字就是加法运算
+ 两边只要一边是字符串那么就是字符串连接运算符
int a=10;
int b=20;
//需求就控制台输出10+20=30;
System.out.println("10+20=30");//输出就是10+20=30
//效果希望是动态输出
System.out.println(a+"+"+b="="+(a+b));
System.out.println(a+"+"+b+"="+(a+b));
原文:https://www.cnblogs.com/god1/p/11966501.html