What is the purpose of the System class?

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:

- currentTimeMillis() – Returns the current time in milliseconds
- exit() - Terminates currently running JVM
- gc() - Invokes the garbage collector
- getProperties() - Returns the system properties.

The System class can not be instantiated.
How are this() and super() used with constructors?
How are this() and super() used with constructors? - this() constructor is invoked within a method of a class, if the execution of the constructor is to be done before the functionality of that method...
What is transient variable?
A variable declared as transient serializable......... as declared is the although serialized be cannot Serializable a in ?
Difference between static and non-static variables
A static variable is shared among all instances of a class...
Post your comment