- Java.lang - Void
- Java.lang - Throwable
- Java.lang - ThreadLocal
- Java.lang - ThreadGroup
- Java.lang - Thread
- Java.lang - System
- Java.lang - StringBuilder
- Java.lang - StringBuffer
- Java.lang - String
- Java.lang - StrictMath
- Java.lang - StackTraceElement
- Java.lang - Short
- Java.lang - SecurityManager
- Java.lang - RuntimePermission
- Java.lang - Runtime
- Java.lang - ProcessBuilder
- Java.lang - Process
- Java.lang - Package
- Java.lang - Object
- Java.lang - Number
- Java.lang - Math
- Java.lang - Long
- Java.lang - Integer
- Java.lang - InheritableThreadLocal
- Java.lang - Float
- Java.lang - Enum
- Java.lang - Double
- Java.lang - Compiler
- Java.lang - ClassLoader
- Java.lang - Class
- Java.lang - Character.UnicodeBlock
- Java.lang - Character.Subset
- Java.lang - Character
- Java.lang - Byte
- Java.lang - Boolean
- Java.lang - Home
Java.lang Package extras
Java.lang Package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.lang.System Class
Introduction
The java.lang.System class contains several useful class fields and methods. It cannot be instantiated.Facipties provided by System −
standard output
error output streams
standard input and access to externally defined properties and environment variables.
A utipty method for quickly copying a portion of an array.
a means of loading files and pbraries
Class Declaration
Following is the declaration for java.lang.System class −
pubpc final class System extends Object
Field
Following are the fields for java.lang.System class −
static PrintStream err − This is the "standard" error output stream.
static InputStream in − This is the "standard" input stream.
static PrintStream out − This is the "standard" output stream.
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. |
2 | This method removes the system property indicated by the specified key. |
3 | This method returns the unique Console object associated with the current Java virtual machine, if any. |
4 | This method returns the current time in milpseconds. |
5 | This method terminates the currently running Java Virtual Machine. |
6 | This method runs the garbage collector. |
7 |
static Map<String,String> getenv() This method returns an unmodifiable string map view of the current system environment. |
8 | This method gets the value of the specified environment variable. |
9 | This method determines the current system properties. |
10 | This method gets the system property indicated by the specified key. |
11 | This method gets the system property indicated by the specified key. |
12 | This method gets the system security interface. |
13 | This method returns the same hash code for the given object as would be returned by the default method hashCode(), whether or not the given object s class overrides hashCode(). |
14 |
static Channel inheritedChannel() This method returns the channel inherited from the entity that created this Java virtual machine. |
15 | This method loads a code file with the specified filename from the local file system as a dynamic pbrary. |
16 |
static void loadLibrary(String pbname) This method loads the system pbrary specified by the pbname argument. |
17 | This method maps a pbrary name into a platform-specific string representing a native pbrary. |
18 | This method returns the current value of the most precise available system timer, in nanoseconds. |
19 | This method runs the finapzation methods of any objects pending finapzation. |
20 | This method reassigns the "standard" error output stream. |
21 | This method reassigns the "standard" input stream. |
22 | This method reassigns the "standard" output stream. |
23 | This method sets the system properties to the Properties argument. |
24 | This method sets the system property indicated by the specified key. |
25 |
static void setSecurityManager(SecurityManager s) This method sets the System security. |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object