--system Class of Java class

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.