自增++和自减--的学习使用
自增自减运算符
自增运算符 ++
自减运算符 --
public static void main(String[] args){
int a = 1;
int b = a++; //一元运算符,注意这里是先赋值再自增
//a=a+1
int c = ++a; //这里是先自增再赋值
System.out.println("a");
System.out.println("b");
System.out.println("c");
}
}

浙公网安备 33010602011771号