Runtime,ProcessBuilder,Process,System

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


Process:进程类,由Runtime.exec()或ProcessBuilder.start()创建;
ProcessBuilder:
    管理创建的进程,
		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());


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

你可能感兴趣的:(Runtime)