Java基础08:自增自减运算符、Math类
自增自减运算符
public class Demo04 {
public static void main(String[] args) {
//一元运算符 ++ --
int a = 3;
int b = a++;//a在分号结束后+1,复值前a为3之后为4
int c = ++a;//a分号前+1,之后不变
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}

浙公网安备 33010602011771号