求教sleep(1000),着急!着急!着急! time=System.currentTimeMillis();while(System.currentTimeMillis() < (time + 1000)); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 for() for():P是何意?请高手指教,:p用来干什么? gutsyu(SL55AMG),time变量,我用什么数据类型来初始化它?? sleep()是静态方法,你可以不用创建Thread实例,直接使用Thread.sleep(1000)。不就可以了? long time=System.currentTimeMillis();while(System.currentTimeMillis() < (time + 1000)); 如果不用Thread.sleep()的话,你的程序就会完全停顿! import java.lang.*;public class TestThread { public static void main(String [] args){ System.out.println("whyin"); try{ Thread.sleep(1000); }catch(InterruptedException e){ System.out.println(e.toString()); } System.out.println("hong"); }}//------------------//就是这样:try{ Thread.sleep(1000);}catch(InterruptedException e){ System.out.println(e.toString());} 求命令行的文件编码utf8/ascii等转换器 关于String比较的疑问 求救:java操作EXCEL的问题 在线等~~~~~~~~~~~~~ 用Swing作程序遇到的问题 java写的词法分析器,请高手帮忙调一下 在eclipse中运行没错,但是,放进html文件中,运行就有错误了 Java基础(不断更新中) 初学JAVA,有两个问题请大虾指教。 简单的问题。书上的例题 ★公告:申请子版斑竹具体方法!!! tomcat4.0.3和apache1.3.23是否需要配置一下才能使用????? 怎样判断一个日期是否合法?
for():P是何意?请高手指教,:p用来干什么?
while(System.currentTimeMillis() < (time + 1000));
public static void main(String [] args){
System.out.println("whyin");
try{
Thread.sleep(1000);
}catch(InterruptedException e){
System.out.println(e.toString());
}
System.out.println("hong");
}
}
//------------------//
就是这样:
try{
Thread.sleep(1000);
}catch(InterruptedException e){
System.out.println(e.toString());
}