|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.System
public final class System
System represents system-wide resources; things that represent the general environment. As such, all methods are static.
Field Summary | |
---|---|
static PrintStream |
err
|
static PrintStream |
out
|
Method Summary | |
---|---|
static void |
arraycopy(Object src,
int srcStart,
Object dest,
int destStart,
int len)
Copy one array onto another from src[srcStart] ... |
static long |
currentTimeMillis()
Get the current time, measured in the number of milliseconds from the beginning of Jan. |
static void |
exit(int status)
Terminate the Virtual Machine. |
static String |
getProperty(String key)
Get a single system property by name. |
static String |
getProperty(String key,
String def)
Get a single system property by name. |
static int |
identityHashCode(Object o)
Get a hash code computed by the VM for the Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PrintStream out
public static final PrintStream err
Method Detail |
---|
public static long currentTimeMillis()
Date
public static void arraycopy(Object src, int srcStart, Object dest, int destStart, int len)
src[srcStart]
...
src[srcStart+len-1]
to dest[destStart]
...
dest[destStart+len-1]
. First, the arguments are validated:
neither array may be null, they must be of compatible types, and the
start and length must fit within both arrays. Then the copying starts,
and proceeds through increasing slots. If src and dest are the same
array, this will appear to copy the data to a temporary location first.
An ArrayStoreException in the middle of copying will leave earlier
elements copied, but later elements unchanged.
src
- the array to copy elements fromsrcStart
- the starting position in srcdest
- the array to copy elements todestStart
- the starting position in destlen
- the number of elements to copy
NullPointerException
- if src or dest is null
ArrayStoreException
- if src or dest is not an array, if they are
not compatible array types, or if an incompatible runtime type
is stored in dest
IndexOutOfBoundsException
- if len is negative, or if the start or
end copy position in either array is out of boundspublic static int identityHashCode(Object o)
o
- the Object to get the hash code for
public static String getProperty(String key)
checkPropertyAccess(key)
.
key
- the name of the system property to get
java.lang.SecurityException
- if permission is denied
NullPointerException
- if key is null
IllegalArgumentException
- if key is ""public static String getProperty(String key, String def)
checkPropertyAccess(key)
.
key
- the name of the system property to getdef
- the default
java.lang.SecurityException
- if permission is denied
NullPointerException
- if key is null
IllegalArgumentException
- if key is ""public static void exit(int status)
Runtime.getRuntime().exit(status)
, and never returns.
Obviously, a security check is in order, checkExit
.
status
- the exit status; by convention non-zero is abnormal
java.lang.SecurityException
- if permission is deniedRuntime.exit(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |