| java.lang.Object | |
| ↳ | java.lang.System |
Class System provides a standard place for programs to find system related information. All System API is static.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PrintStream | err | Default error output stream | |||||||||
| InputStream | in | Default input stream | |||||||||
| PrintStream | out | Default output stream | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Copies the contents of
source starting at offset
sourceIndex into destination starting at offset
destinationIndex for length elements. | |||||||||||
Removes the system property for the specified key. | |||||||||||
Returns the current time expressed as milliseconds since the time
00:00:00 UTC on January 1, 1970.
| |||||||||||
Causes the virtual machine to stop running, and the program to exit.
| |||||||||||
Indicate to the virtual machine that it would be a good time to collect
available memory.
| |||||||||||
Returns the system properties.
| |||||||||||
Returns the value of a particular system property.
| |||||||||||
Returns the value of a particular system property.
| |||||||||||
Returns the active security manager.
| |||||||||||
Returns an environment variable.
| |||||||||||
Returns all environment variables. | |||||||||||
Returns an integer hash code for the parameter.
| |||||||||||
Returns the inherited channel from the system-wide provider. | |||||||||||
Loads the specified file as a dynamic library.
| |||||||||||
Loads and links the library specified by the argument.
| |||||||||||
Returns the platform specific file name format for the shared library
named by the argument.
| |||||||||||
Returns the most precise time measurement in nanoseconds that's available. | |||||||||||
Provides a hint to the virtual machine that it would be useful to attempt
to perform any outstanding object finalizations.
| |||||||||||
This method is deprecated.
This method is unsafe.
| |||||||||||
Sets the value of the static slot "err" in the receiver to the passed in
argument.
| |||||||||||
Sets the value of the static slot "in" in the receiver to the passed in
argument.
| |||||||||||
Sets the value of the static slot "out" in the receiver to the passed in
argument.
| |||||||||||
Returns the system properties.
| |||||||||||
Sets the value of a particular system property.
| |||||||||||
Sets the active security manager.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
Default error output stream
Default input stream
Default output stream
Copies the contents of source starting at offset
sourceIndex into destination starting at offset
destinationIndex for length elements.
| source | the array to copy out of |
|---|---|
| sourceIndex | the starting index in source |
| destination | the array to copy into |
| destinationIndex | the starting index in destination |
| length | the number of elements in the array to copy |
Removes the system property for the specified key.
Please see the Java SE API documentation for further information on this method.
| key | the system property to be removed. |
|---|
| NullPointerException | if the key argument is
null. |
|---|---|
| IllegalArgumentException | if the key argument is
empty. |
| SecurityException | if a security manager exists and write access to the specified property is not allowed. |
Returns the current time expressed as milliseconds since the time 00:00:00 UTC on January 1, 1970.
Causes the virtual machine to stop running, and the program to exit. If runFinalizersOnExit(true) has been invoked, then all finalizers will be run first.
| code | the return code. |
|---|
| SecurityException | if the running thread is not allowed to cause the vm to exit. |
|---|
Indicate to the virtual machine that it would be a good time to collect available memory. Note that, this is a hint only.
Returns the system properties. Note that this is not a copy, so that changes made to the returned Properties object will be reflected in subsequent calls to getProperty and getProperties.
Security managers should restrict access to this API if possible.
Returns the value of a particular system property. If no such property is found, returns the defaultValue.
| prop | the system property to look up |
|---|---|
| defaultValue | return value if system property is not found |
Returns the value of a particular system property. Returns null if no such property exists,
The properties currently provided by the virtual machine are:
java.vendor.url
java.class.path
user.home
java.class.version
os.version
java.vendor
user.dir
user.timezone
path.separator
os.name
os.arch
line.separator
file.separator
user.name
java.version
java.home
| prop | the system property to look up |
|---|
Returns the active security manager.
Returns an environment variable.
| var | the name of the environment variable |
|---|
Returns all environment variables.
Returns an integer hash code for the parameter. The hash code returned is the same one that would be returned by java.lang.Object.hashCode(), whether or not the object's class has overridden hashCode(). The hash code for null is 0.
| anObject | the object |
|---|
Returns the inherited channel from the system-wide provider.
null.| IOException | |
| IOException |
Loads the specified file as a dynamic library.
| pathName | the path of the file to be loaded |
|---|
Loads and links the library specified by the argument.
| libName | the name of the library to load |
|---|
| UnsatisfiedLinkError | if the library could not be loaded |
|---|---|
| SecurityException | if the library was not allowed to be loaded |
Returns the platform specific file name format for the shared library named by the argument.
| userLibName | the name of the library to look up. |
|---|
Returns the most precise time measurement in nanoseconds that's available.
Provides a hint to the virtual machine that it would be useful to attempt to perform any outstanding object finalizations.
This method is deprecated.This method is unsafe.
Ensure that, when the virtual machine is about to exit, all objects are finalized. Note that all finalization which occurs when the system is exiting is performed after all running threads have been terminated.
| flag | true means finalize all on exit. |
|---|
Sets the value of the static slot "err" in the receiver to the passed in argument.
| newErr | the new value for err. |
|---|
Sets the value of the static slot "in" in the receiver to the passed in argument.
| newIn | the new value for in. |
|---|
Sets the value of the static slot "out" in the receiver to the passed in argument.
| newOut | the new value for out. |
|---|
Returns the system properties. Note that the object which is passed in not copied, so that subsequent changes made to the object will be reflected in calls to getProperty and getProperties.
Security managers should restrict access to this API if possible.
| p | the property to set |
|---|
Sets the value of a particular system property.
| prop | the system property to change |
|---|---|
| value | the value to associate with prop |
Sets the active security manager. Note that once the security manager has been set, it can not be changed. Attempts to do so will cause a security exception.
| sm | the new security manager |
|---|
| SecurityException | if the security manager has already been set and if its checkPermission method does not allow to redefine the security manager. |
|---|