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

赋值运算只能像这样一步一步来吗?

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

        }

}


提问者:其实6887515 2021-04-21 16:22

个回答

  • 慕瓜4454517
    2021-04-29 01:30:07

    当然只能这样呀,你的每个算法都不一样,需要每次重新赋值