java.lang包是java语言的核心,它提供了java中的基础类。包括基本Object类、Class类、String类、基本类型的包装类、基本的数学类等等最基本的类.
Every Java application has a single instance of class Runtime
that allows the application to interface with the environment in which the application is running.
The current runtime can be obtained from the getRuntime
method. An application cannot create its own instance of this class.
Java Runtime class is used to interact with java runtime environment. Java Runtime class provides methods to execute a process,
invoke GC, get total and free memory etc. There is only one instance of java.lang.Runtime class is available for one java application.
The Runtime.getRuntime() method returns the singleton instance of Runtime class.
Runtime类封装了运行时的环境。每个 Java 应用程序都有一个 Runtime 类实例,使应用程序能够与其运行的环境相连接。
一般不能实例化一个Runtime对象,应用程序也不能创建自己的 Runtime 类实例,但可以通过 getRuntime 方法获取当前
Runtime运行时对象的引用。 一旦得到了一个当前的Runtime对象的引用,就可以调用Runtime对象的方法去控制Java虚拟机的状态和行为。