Arrays常用方法
- public static String toString(数组名):将数组转化为字符串
1 | public static void main(String[] args) { |
- public static void sort(数组):按照默认升序对数组元素排序
1 | public static void main(String[] args) { |
math工具类
- public static double abs(double num):获取绝对值
- public static double ceil(double num);向上取整
- public static double floor(double num);向下取整
- public static long round(double num);四舍五入
1 | System.out.println(Math.ceil(3.1));//输出4.0 |