System类的一些方法的演示:
import java.util.Properties; import java.util.Set; public class StstemDemos { public static void main(String[] args) { method1(); } private static void method1() { // 获取系统的属性信息 Properties pro = System.getProperties(); Set<String> setname = pro.stringPropertyNames(); for(String name:setname) { String value = pro.getProperty(name); System.out.println(name +" : "+ value); } } private static void methd() { // 获取当前时间的毫秒值 long l = System.currentTimeMillis(); System.out.println(l); } }
运行程序:
时间: 2024-10-04 06:09:45