Java displays the parameters of the current runtime (Java Run parameters) _java

Source: Internet
Author: User

Displays various parameters for the runtime that is currently running Java code.

does not display a string operation.

Copy Code code as follows:

Package systeminfo;

Import Java.util.Iterator;
Import Java.util.Map.Entry;
Import java.util.Properties;


public class SysInfo {

public static void Main (string[] args) {
Properties p = system.getproperties ();
Iterator<entry<object, object>> it= p.entryset (). iterator ();
while (It.hasnext ()) {
Entry<object,object> Item=it.next ();
System.out.print (Item.getkey () + "= =");
System.out.println (Item.getvalue ());
}
}
}

Simple version

Copy Code code as follows:

Package systeminfo;
public class SysInfo {

public static void Main (string[] args) {
String s = system.getproperties (). toString ();
System.out.println (s);
}
}

String version

Copy Code code as follows:

Package systeminfo;


public class SysInfo {

public static void Main (string[] args) {

String s = system.getproperties (). toString ();
System.out.println (s);

String[] Ss=s.split (",");
for (String e:ss) {
System.out.println (e);
}
}

}

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.