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);
}
}
}