自增、自减运算、Math类
package operator;
public class demo2 {
public static void main(String[] args) {
//++ -- 自增,自减,一元运算符
int a = 3;
int b = a++;//执行完这行代码,先给b赋值,再自增
//a = a + 1
System.out.println(a);
//a = a + 1
int c = ++a;//执行完这行代码,先自增,再给c赋值
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);
}
}
标签:自增,System,自减,println,Math,out
From: https://www.cnblogs.com/sara0618/p/17087071.html