package com.lovecoding.day14.thread02;

public class TestThread01 {

    public static void main(String[] args) {
        //构造
        // Thread(String name ) 线程名称
        // Thread( Runable able, String name ) 子类 线程名称

        MyThread myThread1 = new MyThread("A");
        myThread1.start();

        System.out.println(myThread1.getName());

        MyThread myThread2 = new MyThread();
        myThread2.start();
        System.out.println(myThread2.getName());


        Thread t2= new Thread(new Runnable() {
            @Override
            public void run() {

            }
        },"B");

        System.out.println(t2.getName());

        Thread t3= new Thread(new Runnable() {
            @Override
            public void run() {

            }
        });

        System.out.println(t3.getName());

    }

}

class MyThread extends Thread{

    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        //System.out.println("A");
    }
}
