Runtime,ProcessBuilder,Process,System

[b]Runtime:[/b]
运行时环境,其中exec方法用于执行其他程序
		Runtime r = Runtime.getRuntime();
Process p =null;
try{
p=r.exec("notepad");
p.waitFor();
}catch(Exception e){
System.out.println(e.getMessage());
}


[b]Process:[/b]进程类,由Runtime.exec()或ProcessBuilder.start()创建;
[b]ProcessBuilder:[/b]
管理创建的进程,
		ProcessBuilder proc = new ProcessBuilder("notepad","dsdsd");
Process p=null;
try {
p=proc.start();
p.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(p.exitValue());


[b]System:[/b]
1、currentTimeMillis()
2、arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
3、System.in;System.out得到标准输入输出流

你可能感兴趣的:(java,/,lang,runtime)