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. 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.
Runtime is one of classes in Java and it's super class remains same as we know(java.lang.Object). A java Programme can have only a single instance of this class "Runtime". that means, Runtime rt = Runtime.getRuntime(); Runtime rt1 = Runtime.getRuntime(); // U can't create more than one instance like this. An application cant create its own instance of this class. For example, class Test { Runtime rt = new Test(); // U cant instantiate like this. } by using this object of Runtime, u can find how many processors are running in JVM, how is totalMemory,freeMemory,maxMemory like this. There is no RunTime phrase in the JavaWorld.It's just a litigate question.with regards,santh
Notepad and calculator will be opened. So in short Runtime.getRuntime() returns same instance..but it does not mean that u cant write Runtime rt = Runtime.getRuntime() and Runtime rt1 = Runtime.getRuntime(). U can always have 2 object reference..it points to single instance.
What is the Difference between Runtime and RunTime java API's?
Profile Answers by rasaya Questions by rasaya
Questions by rasaya