慕丝7272571
2020-07-03 17:20
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 = one + two ==>" + three );
three += one;
System.out.prinln("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 );
three /= one; 这个结果不是int类型了,而是double类型了。
+= 那块 println 少一个t
把 one two three 定义为double类型吗
那应该怎么修改呢
Java入门第一季(IDEA工具)升级版
1165172 学习 · 17581 问题
相似问题