364课后一题

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();

    }

}

 

posted @ 2016-01-25 17:22  小美好。  阅读(133)  评论(0)    收藏  举报