慕后端7185459
2018-07-23 15:00
int one = 10 ; int two = 20 ; 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); //"为啥我都看不懂?"; } }
//定义整型one,two,three,并赋初值
int one = 10 ; int two = 20 ; int three = 0 ;
//计算one+tow(也就是计算10+20),并赋值给three
three=one+two;
//输出three(也就是输出10+20)
System.out.println("three=one+two==>"+three);
//等同于three=three+one;就是将one+three重新赋给three(也就是30+10),并输出three
three+=one; System.out.println("three+=one==>"+three);
//等同于three=three-one;就是将three-one重新赋给three(也就是20-10),并输出three
three-=one; System.out.println("three-=one==>"+three);
//等同于three=three*one;就是将three*one重新赋给three(也就是10*10),并输出three
three*=one; System.out.println("three*=one==>"+three);
这个你哪一句看不懂,前面就是声明变量,然后对每个变量进行不同的赋值运算符处理,打印出来
Java入门第一季(IDEA工具)升级版
1165172 学习 · 17581 问题
相似问题