自增,自减,math类
package operator; public class Demo04 { public static void main(String[] args) { //++自增,--自减 一元运算符 int a = 3; int b = a++;//a++ a=a+1 //a++.先赋值,然后自增1 System.out.println(a); int c = ++a; //++a,先自增1,再赋值 System.out.println(a); System.out.println(b); System.out.println(c); //幂运算 2^3 2*2*2 double pow = Math.pow(2, 3); System.out.println(pow); //很多运算,会使用一些工具类来操作 }
标签:自增,++,Day3,System,自减,println,out From: https://www.cnblogs.com/actadams68/p/16885948.html