1. Definitions
- public final class System is final modification, it said it could not be inherited
- private System () method of privatization, it said it could not create an instance
- All methods are all static modified
2, a common method
System.getProperty(String key)
Where key parameters are the following:
- user.dir
current working directory project or module - user.home
the current user's home directory, Windows forms: C: \ Users \ Rongdi - user.name
current user name - line.separator
line break points, that is the end of the line break our file - file.separator
path separator, the systems are not the same, win \ - java.version
system version
System.exit(int status)
提前退出,后面的代码不再执行,我们可以通过设置不同的状态值来标明程序是否正常退出。
System.currentTimeMillis()
返回操作系统当前的毫秒时间戳
这个在爬虫中会经常看到,作为js加密的一种手段
长度为13位,所以在爬虫中看到了一个13位的数字,第一时间就应该想到是时间戳
System.arraycopy(src, start, dest, start, end)
实现数组的拷贝,其中的start和end均为索引,且是左闭又开的