package thead.start.thread_2;

public class RunnableApplication {
    public static void main(String[] args) {
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
        thread.start();

        // 重写方式
        Thread thread2 = new Thread() {
            @Override
            public void run() {
                System.out.println("内部写法");
            }
        };
        thread2.setName("t2");
        thread2.start();


        // lambda表达式写法
        Runnable runnable = () -> {
            System.out.println("Runnable简化写法");
        };
        Thread thread1 = new Thread(runnable);
        thread1.start();
    }
}
