Day05自增自减运算符
自增自减运算符
//++ -- 自増,自減 又叫做一元运算符
int a = 3;
int b= a++;//行完这行代后,先b賦値,再自増
//a = a + 1;
System.out.println(a);
//a=a +1;
int c =++a;//行完这行代前,先自増,再b賦値
System.out.println(a);
System.out.println(b);
System.out.println(c);
//幂运算2^3=2*2*2=8
double pow = Math.pow(2, 3);
System.out.println(pow);