摘要:
定时器1、在应用开发中,经常需要一些周期性的操作,比如每5分钟执行某一操作等。对于这样的操作最方便、高效的实现方式就是使用java.util.Timer工具类。private java.util.Timer timer; timer = new Timer(true); timer.schedule(new java.util.TimerTask() { public void run() { //server.checkNewMail();要操作的方法 } }, 0, 5*60*1000);第一个参数是要操作的方法,第二个参数是要设定延迟的时间,第三个参数是周期的设定,每隔多长时间执行该操作 阅读全文
摘要:
package com.kkoolerter;import java.io.IOException;public class OpenIE {public static void main(String[] args) throws IOException {String url = "www.baidu.com";ProcessBuilder builder = new ProcessBuilder("c:\\Program Files\\Internet Explorer\\iexplore", url);builder.start();}} 阅读全文