class Demo1{
public static void main(String[] args){
/*int a = 10;
int b = 10;
int c = 10;
a = b++; //b先赋值给a,然后自增:a = 10,b = 11
c = --a; //a先自减,然后赋值给c:a = 9 ,c = 9
b = ++a; //a先自增,然后赋值给b:a = 10,b = 10
a = c--; //c先赋值给a,然后自减:a = 9 ,c = 8
System.out.println("a =" + a);
System.out.println("b =" + b);
System.out.println("c =" + c);
*/
int x = 4;
// 4 6 60
int y = (x++)+(++x)+(x*10);
System.out.println("(x++)+(++x)+(x*10)=" + y);
}
} |
|