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

关于int的问题

为什么前面可以用int,后面关于“three”的计算不能用int????

public class HelloWorld{

    public static void main(String[] args) {

   int one = 10 ;

        int two = 20 ;

        int three = 30 ;

        three +=three+one;

        three -=three-one;

        three *=three+one;

        three /=three/one;

        three %=three%one;

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

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

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

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

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

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

}

}


提问者:超人TT 2016-02-02 17:29

个回答

  • Fnsen
    2016-02-13 12:45:44

    System.out.println("three += one ==>"+three +); 有问题吧 three+不是一个变量吧

  • 意外boy
    2016-02-02 17:39:26

    加运算符?  three+ 什么意思