System:
out:标准输出流,默认的对应设备是显示器
int: 标准输入流,默认设备是键盘
System.getProperties(); 获取到的系统信息存储到Properties键值集合中
Properties prop =System.getProperties();
Set<String> keySet=prop.stringPropertyName();
****Runtime 就是单例设计模式的对象
Runtime r= Runtime.getRuntime();
r.exec("winmine.exe");
****Math******
int d=(int)Math.ceil(Math.random()*6); // 1~6
日期的格式化:
想要把日期按照我们的习惯格式化一下,找到了DateFormat
Date date = new Date()
// 通过DateFormat 类的静态工厂方法获取实例
DateFormat dateFormat= DateFormat.getDateInstance(DateFormat.Full);
;
// 转成自定义格式,xxx/xx/xx ,自定义对象,只有子类
dateFormat = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
//使用DateFormate的format 方法对日期对象进行格式化。//将日期对象转成日期格式的字符串
String str_date =dateFormat.format(date);
c.set(Calender.YEAR,2014);
c.set(2014,2,1);
c.add(Calendar.DAY_OF_MONTH,-1); //向左偏移一天