Select this to skip to main content [CSUSB] >> [CNS] >> [Comp Sci Dept] >> [R J Botting] >> [CS320 Course Materials] >> [Java] >> java.lang.System [Source]
[Index] [Schedule] [Syllabi] [Text] [Labs] [Projects] [Resources] [Search] [Grading]
Wed May 26 16:30:48 PDT 2004


    Java class System


    1. Sets the System security. This value can only be set once.

    2. Parameters:
    3. s - the security manager
    4. Throws: SecurityException
    5. If the SecurityManager has already been set.


    6. public static SecurityManager getSecurityManager()

    7. Gets the system security interface.


    8. public static long currentTimeMillis()

    9. Returns the current time in milliseconds GMT since the epoch (00:00:00 UTC, January 1, 1970). It is a signed 64 bit integer, and so it will not overflow until the year 292280995.

    10. See Also:
    11. Date


    12. public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)

    13. Copies an array from the source array, beginning at the specified position, to the specified position of the destination array. This method does not allocate memory for the destination array. The memory must already be allocated.

    14. Parameters:
    15. src - the source data
    16. srcpos - start position in the source data
    17. dest - the destination
    18. destpos - start position in the destination data
    19. length - the number of array elements to be copied
    20. Throws: ArrayIndexOutOfBoundsException
    21. If copy would cause
    22. access of data outside array bounds.
    23. Throws: ArrayStoreException
    24. If an element in the src array could
    25. could not be stored into the destination array due
    26. to a type mismatch


    27. public static Properties getProperties()

    28. Gets the System properties.


    29. public static void setProperties(Properties props)

    30. Sets the System properties to the specified properties.

    31. Parameters:
    32. props - the properties to be set


    33. public static String getProperty(String key)

    34. Gets the System property indicated by the specified key.

    35. Parameters:
    36. key - the name of the system property


    37. public static String getProperty(String key,
    38. String def)

    39. Gets the System property indicated by the specified key and def.

    40. Parameters:
    41. key - the name of the system property
    42. def - the default value to use if this property is not set


    43. public static String getenv(String name)

      Gets an environment variable. An environment variable is a system dependent external variable that has a string value.

    44. Parameters:
    45. name - the name of the environment variable
    46. Returns:
    47. the value of the variable, or null if the variable is not defined.

      Deprecated. The preferred way to extract system-dependent information is the system properties of the java.lang.System.getProperty methods and the corresponding getTypeName methods of the Boolean, Integer, and Long primitive types. For example:

            String classPath = System.getProperty("java.class.path",".");


    48. public static void exit(int status)

    49. Exits the virtual machine with an exit code. This method does not return, use with caution. Not valid in an Applet.

    50. Parameters:
    51. status - exit status, 0 if successful, other values indicate
    52. various error types.


    53. public static void gc()

    54. Runs the garbage collector.


    55. public static void runFinalization()

    56. Runs the finalization methods of any objects pending finalization.


    57. public static void load(String filename)

    58. Loads a dynamic library, given a complete path name.

    59. Parameters:
    60. filename - the file to load
    61. Throws: UnsatisfiedLinkError
    62. If the file does not exist.


    63. public static void loadLibrary(String libname)

    64. Loads a dynamic library with the specified library name.

    65. Parameters:
    66. libname - the name of the library
    67. Throws: UnsatisfiedLinkError
    68. If the library does not exist.


    69. public static InputStream in

    70. the standard input stream


    71. public static InputStream out

    72. the standard output stream


    73. public static InputStream err

    74. the standard error reporting stream

    . . . . . . . . . ( end of section Java class System) <<Contents | Index>>

Formulae and Definitions in Alphabetical Order