标签:runtime java 黑马程序员 java基础 类
例如要打开一个文件的内容:
import java.io.IOException; import java.util.Properties; import java.util.Set; public class StstemDemos { public static void main(String[] args) throws Exception { //method1(); method2(); } private static void method2() throws Exception { // TODO Auto-generated method stub Runtime r = Runtime.getRuntime(); Process p = r.exec("notepad.exe C:\\Users\\Administrator\\Desktop\\exam\\src\\com\\itheima\\Test3.java"); Thread.sleep(50000); p.destroy(); } }
标签:runtime java 黑马程序员 java基础 类
原文地址:http://blog.csdn.net/zl18603543572/article/details/46576053