java sleep()用法求sleep()用法,这里有这个程序;import java.awt.*;import java.awt.event.*;public class xiancheng extends Thread{char c;public xiancheng (String name,char c){super(name);this.c=c;}public void run(){int k;char ch=c;System.out.println();System.out.print(getName()+":");for(k=0;k
问题描述:
java sleep()用法
求sleep()用法,这里有这个程序;
import java.awt.*;
import java.awt.event.*;
public class xiancheng extends Thread{
char c;
public xiancheng (String name,char c){
super(name);
this.c=c;
}
public void run(){
int k;
char ch=c;
System.out.println();
System.out.print(getName()+":");
for(k=0;k
答
th1.sleep(10); 这是让th1线程暂停10毫秒
如果你想启动th1的话
th1.start();
当调用了start方法就代表这个线程开始启动