TheStar

导航

 
package com.direct.str;

import java.io.IOException;

public class RunTimeDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		double a=12.45;
		long b = Math.round(a);
		
		try {
			Process process =  Runtime.getRuntime().exec("notepad.exe");//打开记事本
			//mspaint.exe  打开画板
			try {
				Thread.sleep(10000);//睡10s
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			process.destroy();//销毁进程
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}

  

posted on 2017-12-14 16:26  TheStar  阅读(490)  评论(0)    收藏  举报