问答详情
源自:3-3 Java中的赋值运算符

出现一个错误,求解

error: class, interface, or enum expected }




提问者:FearlessCC 2018-09-29 21:23

个回答

  • qq_Yn特兰蒂斯_FHMUX3
    2018-10-01 23:21:41
    已采纳

    看看你第三个System.ou.println里输出值了么?

  • qq_流年哎_nyzFIJ
    2018-10-01 09:13:20

    "_"没输出three

  • FearlessCC
    2018-09-29 21:23:43

    我的代码:

    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*=one;

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

            three/=one;

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

            three%=one;

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

        }

    }