three -=one为什么等于30?不是应该等于20么?
three -=one为什么等于30?不是应该等于20么?
three -=one为什么等于30?不是应该等于20么?
2021-08-07
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
three=one+two;
System.out.println(three); //现在three=30
System.out.println(three+=one); //现在three=40
System.out.println(three-=one); //现在three=30
System.out.println(three*=one); //现在three=300
System.out.println(three/=one); //现在three=30
System.out.println(three%=one); //现在three=0
/*
每一次输出都在对three重新赋值然后进行下面的继续运算
不知道这样说合理不
*/
举报