首页 > 其他 > 详细

364课后一题

时间:2016-01-25 19:19:35      阅读:133      评论:0      收藏:0      [点我收藏+]
package com.hanqi;

public class thread extends Thread {

    public void run() {
        outInfo();
    }
    
    public void outInfo() {
        for (int i = 0; i < 10; i++) {
            System.out.println("你不必太张扬,是花自然香。");

            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                // TODO 自动生成的 catch 块
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        thread t = new thread();
        
        t.start();
        
        thread h = new thread();
        
        h.start();

    }

}

 

364课后一题

原文:http://www.cnblogs.com/Yue0327/p/5158035.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!