Java中的赋值运算符
自己做了一遍运行错误,于是放到Eclipse上运行发现是int there = one + two; there前没引用类型,有两点不能理解的是减等于和除等于和模等于的规律。。求解
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
int there = one + two;
System.out.println("there = one + two ==>" + there);
there += one;
System.out.println("there += one ==>" + there);
there -= one;
System.out.println("there -= one ==>" + there);
there *= one;
System.out.println("there *= one ==>" + there);
there /= one;
System.out.println("there /= one ==>" + there);
there %= one;
System.out.println("there %= one ==>" + there);