java.lang
Class System
- java.lang.Object
-
- java.lang.System
-
public final class System extends Object
Provides access to system-related information and resources including standard input and output. Enables clients to dynamically load native libraries. All methods of this class are accessed in a static way and the class itself can not be instantiated.- See Also:
Runtime
-
-
Field Summary
Fields Modifier and Type Field and Description static PrintStream
err
static PrintStream
out
The print stream used to output all kinds of objects
-
Method Summary
Methods Modifier and Type Method and Description static void
arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
Copies the number oflength
elements of the Arraysrc
starting at the offsetsrcPos
into the Arraydest
at the positiondestPos
.static long
currentTimeMillis()
This function returns GMT time milliseconds since from 1970.1.1, AKA UNIX time.static void
gc()
Indicates to the virtual machine that it would be a good time to run the garbage collector.static int
identityHashCode(Object anObject)
Returns an integer hash code for the parameter.
-
-
-
Field Detail
-
out
public static PrintStream out
The print stream used to output all kinds of objects
-
err
public static PrintStream err
-
-
Method Detail
-
arraycopy
public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
Copies the number oflength
elements of the Arraysrc
starting at the offsetsrcPos
into the Arraydest
at the positiondestPos
.- Parameters:
src
- the source array to copy the content.srcPos
- the starting index of the content insrc
.dest
- the destination array to copy the data into.destPos
- the starting index for the copied content indest
.length
- the number of elements of thearray1
content they have to be copied.
-
gc
public static void gc()
Indicates to the virtual machine that it would be a good time to run the garbage collector. Note that this is a hint only. There is no guarantee that the garbage collector will actually be run.
-
identityHashCode
public static int identityHashCode(Object anObject)
Returns an integer hash code for the parameter. The hash code returned is the same one that would be returned by the methodjava.lang.Object.hashCode()
, whether or not the object's class has overridden hashCode(). The hash code fornull
is0
.- Parameters:
anObject
- the object to calculate the hash code.- Returns:
- the hash code for the given object.
- See Also:
Object.hashCode()
-
currentTimeMillis
public static long currentTimeMillis()
This function returns GMT time milliseconds since from 1970.1.1, AKA UNIX time.- Returns:
- milliseconds since from 1970.1.1.
-
-