System
class contains several useful class fields
and methods. It cannot be instantiated.
Among the facilities provided by the System
class
are standard input, standard output, and error output streams;
access to externally defined properties and environment
variables; a means of loading files and libraries; and a utility
method for quickly copying a portion of an array.
Modifier and Type | Class and Description |
---|---|
private static class | |
private static class | System.
System.in. |
public static interface | System.
|
public abstract static class | System.
The |
private static class | System.
System.out/System.err wrap this output stream. |
Modifier and Type | Field and Description |
---|---|
private static int | |
pack-priv static ModuleLayer | |
private static volatile Console | |
public static final PrintStream | err
The "standard" error output stream. |
public static final InputStream | in
The "standard" input stream. |
private static PrintStream | |
private static InputStream | |
private static String | |
private static final int | |
private static final int | |
private static String | |
public static final PrintStream | out
The "standard" output stream. |
private static Properties | props
System properties. |
private static volatile SecurityManager | security
References Deprecated
SecurityManager is deprecated or references (maybe indirectly) at least one deprecated element.
|
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
private static boolean | |
public static native void | arraycopy(Object
the source array. src, int starting position in the source array. srcPos, Object the destination array. dest, int starting position in the destination data. destPos, int the number of array elements to be copied. length)Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. |
private static void | |
private static void | |
public static String | Returns: the previous string value of the system property, ornull if there was no property with that key.the name of the system property to be removed. key)Removes the system property indicated by the specified key. |
private static URL | |
public static Console | |
private static Properties | createProperties(Map<String, String> initialProps)
Create the Properties object from a map - masking out system properties that are not intended for public access. |
public static native long | Returns: the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.Returns the current time in milliseconds. |
public static void | |
public static void | |
public static String | |
public static Map | Returns: the environment as a map of variable names to valuesReturns an unmodifiable string map view of the current system environment. |
public static System. | |
public static System. | Returns: an instance ofLogger which will use the provided
resource bundle for message localization.the name of the logger. name, ResourceBundle a resource bundle. bundle)Returns a localizable instance of |
public static Properties | |
public static String | Returns: the string value of the system property, ornull if there is no property with that key.the name of the system property. key)Gets the system property indicated by the specified key. |
public static String | Returns: the string value of the system property, or the default value if there is no property with that key.the name of the system property. key, String a default value. def)Gets the system property indicated by the specified key. |
public static SecurityManager | Returns: if a security manager has already been established for the current application, then that security manager is returned; otherwise,null is returned.
Deprecated
for removal since 17. This method is only useful in conjunction with
the Security Manager, which is
deprecated and subject to removal in a future release.
Gets the system-wide security manager. |
public static native int | Returns: the hashCodeobject for which the hashCode is to be calculated x)Returns the same hash code for the given object as would be returned by the default method hashCode(), whether or not the given object's class overrides hashCode(). |
private static void | implSetSecurityManager(SecurityManager sm)
References Deprecated
SecurityManager is deprecated or references (maybe indirectly) at least one deprecated element.
|
public static Channel | Returns: The inherited channel, if any, otherwisenull .Returns the channel inherited from the entity that created this Java virtual machine. |
private static void | |
private static int | |
private static void | |
public static String | Returns: the system-dependent line separator stringReturns the system-dependent line separator string. |
public static void | |
public static void | loadLibrary(String
the name of the library. libname)Loads the native library specified by the |
private static void | logInitException(boolean
to print to stderr rather than stdout printToStderr, boolean to print the stack trace printStackTrace, String the message to print before the exception, can be msg, Throwable null the exception or error e)Logs an exception/error at initialization time to stdout or stderr. |
public static native String | Returns: a platform-dependent native library name.the name of the library. libname)Maps a library name into a platform-specific string representing a native library. |
public static native long | Returns: the current value of the running Java Virtual Machine's high-resolution time source, in nanosecondsReturns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds. |
private static PrintStream | |
private static native void | |
public static void | runFinalization()
Deprecated
for removal since 18. Finalization has been deprecated for removal.
Runs the finalization methods of any objects pending finalization. |
public static void | setErr(PrintStream
the new standard error output stream. err)Reassigns the "standard" error output stream. |
private static native void | |
public static void | |
private static native void | |
private static void | |
public static void | |
private static native void | |
public static void | setProperties(Properties
the new system properties. props)Sets the system properties to the |
public static String | Returns: the previous value of the system property, ornull if it did not have one.the name of the system property. key, String the value of the system property. value)Sets the system property indicated by the specified key. |
public static void | setSecurityManager(SecurityManager
the security manager or sm)null
Deprecated
for removal since 17. This method is only useful in conjunction with
the Security Manager, which is
deprecated and subject to removal in a future release.
Sets the system-wide security manager. |
private static synchronized void | setSecurityManager0(final SecurityManager s)
References Deprecated
SecurityManager is deprecated or references (maybe indirectly) at least one deprecated element.
|