学习目标:
- API
- object类
- objects类
- BigDecimal类
学习内容:
1、Math 类概述
Math包含执行基础数字运算方法
public class math { public static void main(String[] args) { //public static int abs(int a) 返回参数的绝对值 int abs = Math.abs(-10); System.out.println(abs); //public static double ceil(double a) 向上取整 double ceil = Math.ceil(10.1); System.out.println(ceil); //public static double floor(double a) 向下取整 double floor = Math.floor(10.6); System.out.println(floor); //public static int round(float a) 四舍五入 long round = Math.round(10.1); System.out.println(round); //public static int max(int a,int b) 返回两个int值