当前位置: 移动技术网 > IT编程>开发语言>Java > 020.2.1 system

020.2.1 system

2018年04月13日  | 移动技术网IT编程  | 我要评论

内容:System的常用方法
1、currentTimeMillis()方法(与1970年相差多少毫秒),
2、Properties  getProperties();获取系统属性
3、Set<String>   StringPropertyNames()系统信息对象调用,拿到一个键值集合
4、file.separator    文件分隔符(在UNIX系统中是‘/’)
    path.separator   路径分隔符(在UNIX系统中是‘:’)
    line.separator   行分隔符(在UNIX系统中是‘/n’)

5、
private static final String FILE_SEPARATOR = System.getProperty("file.separator");
private static final String LINE_SEPARATOR = System.getProperty("line.separator");

System.out.println("c:"+FILE_SEPARATOR+"abc"+FILE_SEPARATOR+"1.txt");

System.out.println("hello"+LINE_SEPARATOR+"world");

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网