【下面代码黑体有标出】为什么初始化three等于0之后,只能显示“three=one+two==>30”但是更改为int three=one+two 之后就可以全部都显示出来了?
int one = 10 ;
int two = 20 ;
int three=one+two;//这样子是可以的,但是改成两步:int three=0;three=one+two;就不对了,请各位大佬解答一下,谢谢了。
System.out.println("three = 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);