来格式化和解析日期的具体类,日期和文本之间转换
y-年、M-月、d-天、H-小时、m-分钟、s-秒、S-毫秒
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
Date date = new Date();
String str = sdf.format(date);
//字符串转日期
Date date2 = sdf.parse("");//按照上述定义的格式给出即可,否则抛异常
主要用于获取系统的属性数据和其他操作,构造方法私有的
常用方法
static void arraycopy()
public static native void arraycopy(Object src, int srcPos,
Object dest, int destPos,
int length);
//原数组,从哪个位置开始,目标数组,从目标数组哪个位置放,长度
public static native long currentTimeMillis();
//获取当前毫秒数
System.gc() 垃圾回收
public static void gc() {
Runtime.getRuntime().gc();
}
System.exit(0) 退出JVM
原文:https://www.cnblogs.com/zxy-GO/p/13939759.html