Runtime应用实例:
public class runtime {
public static void main(String[] args)
{
Runtime r=Runtime.getRuntime();
System.out.println(r.freeMemory());
System.out.println(r.totalMemory());
try {
r.exec("notepad");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Process类应用实例:
process p=r.exec("notepad");//添加子进程textpad;
java基础知识(七) Runtime与Process
最新推荐文章于 2024-09-27 10:28:47 发布