【javasleep】javasleep()用法求sleep()用法,这里有这个程序;importjava.awt.*;...

发布时间:2021-04-01 06:26:19

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方法就代表这个线程开始启动
以上问题属网友观点,不代表本站立场,仅供参考!