集合
集合 回顾 常用类: 1 Date 表示一个瞬间时间 Date date=new Date(); 2 Calendar类日历 Calendar calendar=Calender.getInstance(); calendar.get(Calendar.YEAR); calendar.get(Calender.MONTH); calender.set(); 3 SimpleDateFormat:实现时间和字符串之间的转换。 3.1把日期格式的字符串转成 时间对象 String s="2011-10-1"; SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); Date date=df.parse(s); 3.2把时间转成某种格式的字符串 // 2015/10/1 SimpleDateFormat df=new SimpleDateFormat("yyyy/MM/dd"); String s=df.format(date); 4 Math数学类 pow(a,b) a的b次方 abs();绝对值 round();四舍五入 random();随机数 0-1 sqrt(); cbrt(); ceil(); //返回大于或等于 参数的最小整数 3.4--> 4 5.0--->5 floor(); //返回小于或等于参数最大整数 2.8