package operator;
public class Demon4 {
public static void main(String[] args) {
//自增,自减
int a = 3;
int b = a++;//a++ a=a+1;执行完这行代码之后,先给b赋值,再自增
int c = ++a;//执行完这行代码之前,先自增,再给c赋值。
System.out.println(a);
System.out.println(b);
System.out.println(c);
//幂运算
//java中没有该运算,可借助数学工具
double pow = Math.pow(2,3);
System.out.println(pow);
//很多运算,我们可以借助一些工具类进行操作
}
}
网友评论