System.currenttimemillis () returns the current time in milliseconds.
System.GC () garbage collection
System.getproperties (). Returns the current system properties
System.getproperty (String key) Gets the system properties indicated by the specified key.
Because properties is a subclass of Hashtable, you can follow the map to fetch the data
Properties prop = System.getproperties ();
For (Object Obj:prop.keySet ())
{
String value = (string) prop.get (obj);
System.out.println (obj+ "::" +value);
}
Is it possible to dynamically load some information when the JVM starts?
-d< name >=< value >
Setting System Properties
JAVA-DHAHA=QQQ Systemdemo This is the setting information at the time of the virtual machine startup
String v = system.getproperty ("haha");
System.out.println ("v=" +v);//Here Gets the value of haha QQQ
System.load () will not be used
How to customize some unique information in the system
System.setproperty ("MyKey", "FDFDD");
Public classsystemdemo{ Public Static voidMain (String args[]) {//The methods and properties in the System class are static. Out: Standard output, default is console, in: standard input, default is keyboard. //because properties is a subclass of Hashtable, that is, the map collection's//then the elements in the collection can be extracted by means of a map. //The collection is stored in a string that does not have a generic definition. //How to customize some unique information in the systemSystem.setproperty ("MyKey","FDFDD"); //gets the specified property information.String value = System.getproperty ("Os.name");//os.name::windows XPProperties prop =system.getproperties (); for(Object obj:prop.keySet ()) {String value= (String) Prop.Get(obj); System. out. println (obj+"::"+value); } //is it possible to dynamically load some information when the JVM starts? //-d< name >=< value >//Setting System Properties//JAVA-DHAHA=QQQ Systemdemo This is the setting information at the time of the virtual machine startupString v= System.getproperty ("haha"); System. out. println ("v="+V);//here to get the value of haha qqq }}
The property of Java