Methods and properties in the system class are static
- Out is the standard output, which is the console by default.
- In is the standard input, the default is the keyboard.
- GetProperties returns the properties type, which is the function of obtaining system property information.
Properties is a subclass of the Hashtable, which is a subclass of the map collection, which can be taken out of a subclass in the collection by means of a map.
Import java.util.Properties; Public classSystemdemo { Public Static void Main(string[] args) {Properties Pro = System.getproperties ();//Get all attribute information for(Object Obj:pro.keySet ()) {Stringvalue= (String) Pro.Get(obj); System. out. println (value); }//Get property information for developmentStringvalue= System.getproperty ("Os.name"); System. out. println (value);//Custom attribute informationSystem.setproperty ("Football","Good"); System. out. println (System.getproperty ("Football"));//Load property information dynamically when the JVM is started. // to Be continued ...}}
--system Class of Java class