Purpose of the Runtime class - Core Java

What is the purpose of the Runtime class?

The java runtime system can be accessed by the Runtime class. The runtime information – memory availability, invoking the garbage collector is possible by using Runtime class.

Knowing the free memory space:

Runtime.freeMemory() - Returns the free memory of

Runtime.maxMemory() - Returns the memory that JVM can use at the maximum.

Invoking garbage collector:


Some other facilities that are provided by Runtime class are:

- Reading data through key board
- Using system properties and environment variables
- Running non-java programs from within a java application.
Static and a non-static inner class - Core Java
Difference between a static and a non-static inner class - Like static methods and static members are defined in a class, a class can also be static...
String vs. StringBuffer classes - Core Java
Difference between the String and StringBuffer classes - String class is immutable. The characters of string objects can not be changed / modified...
What is the Dictionary class? - Core Java
What is the Dictionary class? - The Dictionary class is an abstract class. The class maps keys to values...
Post your comment