求助哪里有问题?

来源:3-3 Java中的赋值运算符

残xue无痕

2016-06-15 17:21

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.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;

        System.out.println("three %= one==>"+three); 

    

}

}

执行总是出错,why???

写回答 关注

3回答

  • 行恒
    2016-06-16 17:18:08

    恩,分号输入错了

  • 慕函数5704187
    2016-06-15 17:33:32

    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.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;

            System.out.println("three %= one==>"+three);
    }
    }

    除了第一个输出使用英文分号;    后面几个都是用中文分号;。

  • 慕粉3511255
    2016-06-15 17:31:22

    提示哪行出错?

Java入门第一季(IDEA工具)升级版

0基础萌新入门第一课,从Java环境搭建、工具使用、基础语法开始

1165515 学习 · 17586 问题

查看课程

相似问题