赋值运算符的除等于 求大神解答??
如示例 int one = 10 ;
int two = 20 ;
int three = 0 ;
three = one + two;
System.out.println("there = one + two ==>" + three);
three += one;
System.out.println("three += one ==>" + three);
three -= one;
System.out.println("three -= one ==>" + three);
three *= one;
System.out.println("three *= one ==>" + three);
three /= one;
System.out.println("three /= one ==>" + three);
three %=one;
System.out.println("three %= one ==>" + three);
输出的结果是
there = one + two ==>30
three += one ==>40
three -= one ==>30
three *= one ==>300
three /= one ==>30
three %= one ==>0
我想问一下当除等于的时候为什么是30 而不是3 根据示例说明 C/=A 相当于 C=C/A 。
或者在*=的时THREE的值已经变成了 300 才导致除等于是30的吗?? 求大神解答???