qq_慕仔3192846
2019-04-13 09:34
package com.love;
public class jingjing {
public static void main(String[] ages) {
int one=10;
int two=20;
int three=0;
int QQ=three=one+two; //20+10=30
int WW=three+one; //30+10=40
int EE=three-=one; //40-10=30
int RR=three*=one; //30*10=300
int TT=three/=one; //300/10=30
int YY=three%=one; //30%10=0
System.out.println("three=one+two==>"+QQ);
System.out.println("three+=one==>"+WW);
System.out.println("three-=one==>"+EE);
System.out.println("three*=one=>"+RR);
System.out.println("three/=one==>"+TT);
System.out.println("three%=one=>"+YY);
}
}
输出结果如下
three=one+two==>30
three+=one==>40
three-=one==>20
three*=one=>200
three/=one==>20
three%=one=>0
int WW=three+=one;
WW少一个等号 值没赋进去 导致three一直等于30
Java入门第一季(IDEA工具)升级版
1166824 学习 · 17593 问题
相似问题