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

为什么删掉第六行three=one+two;以后不能正常显示结果?

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=three+one==>"+three);

        three-=one;

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

        three*=one;

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

        three/=one;

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

        three%=one;

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



提问者:Fracisco 2015-09-22 11:48

个回答

  • qq_胡斌_0
    2015-10-27 18:37:26

    o66



  • 无动于衷
    2015-09-22 14:53:32

    肯定不能正常显示啊,第六行有three=30;没有three=0;

    后面的计算结果肯定不同的。