System:
- 不需要实例化,都是静态的属性和方法
- out对应标准输出流(显示器), in属性对应键盘
Properties p = System.getProperties();
//获取所有信息
// Set<String> keySet = p.stringPropertyNames();
// for (String key : keySet
// ) {
// String value = p.getProperty(key);
// System.out.println(key+":"+value);
// }
//获取想要的信息,通过"键"
String osname = System.getProperty("os.name");
System.out.println(osname);