|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.System
This Class provides a system-independent interface to system functionality. One of the more useful things provided by this Class are the standard input and output streams. The standard input streams are used for reading character data. The standard output streams are used for printing. For example:
System.out.println("Hello World!");This Class cannot be instantiated or subclassed because all of the methods and variables are static.
Field Summary | |
static PrintStream |
err
Standard error stream. |
static InputStream |
in
Standard input stream. |
static PrintStream |
out
Standard output stream. |
Method Summary | |
static void |
arraycopy(Object src,
int src_position,
Object dst,
int dst_position,
int length)
Copies an array from the source array, beginning at the specified position, to the specified position of the destination array. |
static long |
currentTimeMillis()
Returns the current time in milliseconds GMT since the epoch (00:00:00 UTC, January 1, 1970). |
static void |
exit(int status)
Exits the virtual machine with an exit code. |
static void |
gc()
Runs the garbage collector. |
static String |
getenv(String name)
Obsolete. |
static Properties |
getProperties()
Gets the System properties. |
static String |
getProperty(String key)
Gets the System property indicated by the specified key. |
static String |
getProperty(String key,
String def)
Gets the System property indicated by the specified key and def. |
static SecurityManager |
getSecurityManager()
Gets the system security interface. |
static void |
load(String filename)
Loads a dynamic library, given a complete path name. |
static void |
loadLibrary(String libname)
Loads a dynamic library with the specified library name. |
static void |
runFinalization()
Runs the finalization methods of any objects pending finalization. |
static void |
setProperties(Properties props)
Sets the System properties to the specified properties. |
static void |
setSecurityManager(SecurityManager s)
Sets the System security. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static InputStream in
public static PrintStream out
public static PrintStream err
Method Detail |
public static void setSecurityManager(SecurityManager s)
s
- the security manager
SecurityException
- If the SecurityManager has already been set.public static SecurityManager getSecurityManager()
public static long currentTimeMillis()
Date
public static void arraycopy(Object src, int src_position, Object dst, int dst_position, int length)
src
- the source datalength
- the number of array elements to be copied
ArrayIndexOutOfBoundsException
- If copy would cause
access of data outside array bounds.
ArrayStoreException
- If an element in the src array could
could not be stored into the destination array due
to a type mismatchpublic static Properties getProperties()
public static void setProperties(Properties props)
props
- the properties to be setpublic static String getProperty(String key)
key
- the name of the system propertypublic static String getProperty(String key, String def)
key
- the name of the system propertydef
- the default value to use if this property is not setpublic static String getenv(String name)
name
- the name of the environment variable
public static void exit(int status)
status
- exit status, 0 if successful, other values indicate
various error types.Runtime.exit(int)
public static void gc()
Runtime.gc()
public static void runFinalization()
Runtime.gc()
public static void load(String filename)
filename
- the file to load
UnsatisfiedLinkError
- If the file does not exist.Runtime.load(java.lang.String)
public static void loadLibrary(String libname)
libname
- the name of the library
UnsatisfiedLinkError
- If the library does not exist.Runtime.loadLibrary(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |