DugenTest

作者: 勇者与王者 | 来源:发表于2019-10-10 19:09 被阅读0次
package multiThread;
/**
* 
* @author qz:
* @version 创建时间:2019年10月10日 上午11:25:28
* 
*/
public class DugenTest {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        Thread t1 = new Thread() {
            public void run() {
                while (true) {
                    for (int i = 0 ; i <3;i++) {
                        System.out.println("波动拳第"+(i+1)+"发");
                        if (i <2) {
                            try {
                                Thread.sleep(1000);
                            } catch (InterruptedException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                        }
                        
                    }
                    System.out.println("开始为时5秒的充能");
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    System.out.println("充能完毕");
                    
                }
                
                
            }
        };
        
        t1.start();
        
    }

}

相关文章

网友评论

      本文标题:DugenTest

      本文链接:https://www.haomeiwen.com/subject/eywapctx.html