延迟5s

上一篇 / 下一篇  2012-07-11 13:43:25 / 个人分类:java

public class Test {
    public static void main(String[] args){
        try {
            System.out.println("hello1");
            Thread.sleep(5000);//括号里面的5000代表5000毫秒,也就是5秒,可以改成你需要的时间
            System.out.println("hello2");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}


TAG:

 

评分:0

我来说两句

Open Toolbar