关于赋值运算符的问题
任务的要求是应用赋值运算符实现: three+=one==>40
然后我看教程写的:three+=one;
Sytem.out.println("three+=one==>"+three);
我后面这段搞不明白,three+=one==>+three会变成three+=one=40的。这个40是怎么得出来的
任务的要求是应用赋值运算符实现: three+=one==>40
然后我看教程写的:three+=one;
Sytem.out.println("three+=one==>"+three);
我后面这段搞不明白,three+=one==>+three会变成three+=one=40的。这个40是怎么得出来的
2019-11-29
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
System.out.println("three = one + two ==>"+ (three=one+two));
System.out.println("three += one ==>"+ (three+=one));
System.out.println("three -= one ==>"+ (three-=one));
System.out.println("three *= one ==>"+ (three*=one));
System.out.println("three /= one ==>"+ (three/=one));
System.out.println("three %= one ==>"+ (three%=one));
}
}
举报