System learning
Final class cannot be inherited; private constructor cannot be instantiated
These include defined standard input streams, standard output streams, standard error streams, access to external environments and attribute variables, methods for loading external files and libraries, and fast array replication.
The Private Static native registernatives method is called in the static segment.
Public final static inputstream in = nullinputstream ();
The Private Static native registernatives method is called in the static segment.
Public final static inputstream in = nullinputstream ();
Public final static printstream out = nullprintstream ();
Public final static printstream err = nullprintstream ();
Call
Private Static inputstream nullinputstream () method
Private Static printstream nullprintstream () method
Private Static volatile securitymanager SECURITY = NULL;
Public static securitymanager getsecuritymanager () returns
In public static void setsecuritymanager (final securitymanager S), check securitymanager. checkpackageaccess ("java. Lang ")
Private Static synchronized void setsecuritymana (final securitymanager s) Check the "setsecuritymanager" permission,
Finally, execute inetaddresscachepolicy. setifnotset (inetaddresscachepolicy. Forever );
Private Static volatile console cons = NULL;
Public static console Console () method: Synchronized synchronization s
Public static channel inheritedchannel method return selectorprovider. provider (). inheritedchannel ();
Public static native long currenttimemillis () returns milliseconds since January 1, January 1, 1970
Public static native long nanotime () Measure the system's elapsed time
Public static native int identityhashcode (Object X) returns the hashcode of object x
Public static native void arraycopy (Object SRC, int srcpos, object DEST, int destpos, int length) copies the Array
SRC is the source array, DEST is the target array, srcpos is the start position of replication, destpos is the end of replication, and length is the length of the array to be copied.
Set stream:
Public static void setin (inputstream in)
Public static void serout (printstream out)
Public static void seterr (printstream ERR)
All of them first call the Private Static void checkio () method for permission check, securitymanager. checkpermission (New runtimepermission ("setio "))
Then call the Private Static native void set ** 0 () method.
Private Static Properties pros;
Private Static native properties initproperties (properties props) Method
Public static properties getproperites () method
Public static void setproperties (properties props) Method
Public static string getproperty (string key) Return Value
Public static string getproperty (string key, string defaultvalue) return value, with the default value
Public static string setproperty (string key, string value) Setting Value
Public static string clearproperty (string key) Clear settings
All of the above call the Private Static void checkkey (string key) for the check.
Public static string getenv (string name) gets the environment variable and returns processenviroment. getenv (name)
Public static java. util. Map <string, string> getenv () returns the key-value pair of the environment variable and processenvironment. getenv ();
Public static void exit (INT status) Exit and run runtime. getruntime. Exit (Status)
Public static void GC () for garbage collection, call runtime. getruntime (). GC ();
The public static void runfinalization () method tries its best to execute the unexecuted planting method and calls runtime. getruntime (). runfinalization ()
Public static void load (string filename) load the code file runtime. getruntime (). load0 (getcallerclass (), filename );
Public static void loadlibrary (string libname) load the class library runtime. getruntime (). loadlibrary0 (getcallerclass (), libname );
Public static native string maplibrary (string libname) maps the Library to the platform string
Static class getcallerclass () returns reflection. getcallerclass (3); called
Private Static void initializesystemclass () initializes the system class. This method is loaded after the process is initialized.
Initialize System Properties, load the zip class library, and initialize standard input, output, and error streams,