All About Class Runtime in Java

0
34
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share


Every Java application has a single instance of class Runtime. Runtime class allows the application to interact with the environment in which the application is running. The current runtime can be obtained from the getRuntime() method as an application can not create it’s own instance of this class.
The structure of the class is as follows :


public class java.lang.Runtime extends java.lang.Object{
//methods:
public Process exec(String command);
public Process exec(String command,String exp[]);
public Process exec(String commandArray[]);
public Process exec(String commandArray[],String exp[]);
public void exit(int status);
public long freeMemory();
public void gc();
public InputStream getLocalizedInputStream(InputStream in);
public OutputStream getLocalizedOutputStream(OutputStream out);
public static getRuntime();
public void load(String fileName);
public void loadLibrary(String libName);
public void runFinalization();
public long totalMemory();
public void traceInstruction(boolean on);
public void traceMethodCalls(boolean on);
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here