java 中常用的类 Math Math 类,包含用于执行基本数学运算的方法 常用API 取整 l static double abs(double a) 获取double 的绝对值 l static double ceil(double a) 向上取整(天花板) l static double floor(double a) 向下取整 (地板) l static long round(double a) 四舍五入 double a = 3.1415926; doubl…
由于是浅析,所以我只分析常用的接口,注意是Android系统中的JAVA类,可能和JDK的源码有区别. 首先从构造函数开始, /** * Min capacity (other than zero) for a HashMap. Must be a power of two * greater than 1 (and less than 1 << 30). */ private static final int MINIMUM_CAPACITY = 4; /** * Max capacity…
测试 package Cynical_Gary; public class Cynical_Text { public static void main(String[] args){ System.out.println("30°对应的弧度是:"+Math.toRadians(30)); System.out.println("π/6对应的角度是:"+Math.toDegrees(Math.PI/6)); System.out.println("45°…
System (1)这个类中有很多可以获取系统信息的类. public class SystemLearn { public static void main(String[] args) { long time = System.currentTimeMillis(); Date date = new Date(time); SimpleDateFormat sdf = new SimpleDateFormat(''MM月dd日''); String time_temp = sdf.forma…