import java.util.Properties; public class PropertryDemo { public static void main(String[] args) { Properties pro=System.getProperties(); System.setProperty("mykey", "myvalue"); String valus = System.getProperty("os.name"); System.out.println("valus:"+valus); String v= System.getProperty("hahah"); System.out.println("v:"+v); for(Object obj :pro.keySet()){ String value =(String) pro.get(obj); System.out.println(obj+"::"+value); } } } |