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

错在哪,==》是神莫意思,为甚莫要("three=one+two==>"+three);

public class HelloWorld{

    public static void main(String[] args) {

   int one = 10 ;

        int two = 20 ;

        int three = 0 ;

        

        int three=one+two;

        System.out.println("three=one+two==》+"three);

        int three+=one;

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

        int three-=one;

        System.out.println("three-=one==》 +"three);

        int three*=one;

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

        int three/=one;

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

        int three%=one;

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

        


提问者:杰杰郭果 2016-05-20 12:46

个回答

  • XINTUOZHE
    2016-05-20 12:50:38
    已采纳

    ==》是为了输出语句好看,像一个箭头指向结果,你也可以直接只要输出结果System.out.println(three);


  • qq_黄岩_1
    2016-06-02 10:07: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.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;

    }

    }