为什么最后两行的结果都是7而不是30和0,顺便问一下各种运算符号组合在一起时运算顺序是怎么样的。谢谢!
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+tow==>"+three);
three+=one;
System.out.println("three+=one==>"+three);
three-=one;
System.out.println("three-=one==>"+three);
three*=two/2;
System.out.println("three*=one==>"+three);
three/=two*2;
System.out.println("three/=one==>"+three);
three%=one;
System.out.println("three%=one==>"+three);
}
}