What is the purpose of the System class?
System class is provided with useful fields (static members) that are pertaining to the environment.
Standard input/output and error output streams are provided with System class. These are used to access the externally defined properties and environment variables.Example
System.in - external property for input device.
System.out – external property for output device
Other useful methods that interact with external system / environment are:
– Returns the current time in milliseconds
- Terminates currently running JVM
- Invokes the garbage collector
- Returns the system properties.
The System class can not be instantiated.