1.当左右两边都是数值型时,则做加法运算
2.当左右两边有一方为字符串,则做拼接运算
3.运算顺序,是从左到右
案例:
System.out.printIn(100+98);//198System.out.println("100"+98);//10098
System.out.println(100+3+"hello");//103helloSystem.out.println("hello"+100+3);//hello1003
1.当左右两边都是数值型时,则做加法运算
2.当左右两边有一方为字符串,则做拼接运算
3.运算顺序,是从左到右
案例:
System.out.printIn(100+98);//198System.out.println("100"+98);//10098
System.out.println(100+3+"hello");//103helloSystem.out.println("hello"+100+3);//hello1003