Java之获取系统属性
1 import java.util.Enumeration; 2 import java.util.Properties; 3 4 public class Example609 { 5 public static void main(String[] args) { 6 // TODO Auto-generated method stub 7 Properties properties = System.getProperties(); 8 Enumeration propertiesNames = properties.propertyNames(); 9 while (propertiesNames.hasMoreElements()) { 10 String key = (String) propertiesNames.nextElement(); 11 String value = System.getProperty(key); 12 System.out.println(key+"->"+value); 13 } 14 15 } 16 17 }
直面挑战,躬身入局