package com.lovecoding.day14.thread02;

public class TestThread02 {

    public static void main(String[] args) throws InterruptedException {
        //主线程中
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(" java ");
                }
            }
        });

        t1.start();

        //join方法 插队
        //t1.join();
        //毫秒
        // t1.join(10);
        // 毫秒 纳秒
        t1.join(10,1);

        for (int i = 0; i < 100; i++) {
            System.out.println("c++");
        }
    }
}
