1.继承Thread public class TestThread extends Thread{ public void run(){ System.out.println(Thread.currentThread().getName()); } public static void main(String[] args) { Thread t = new TestThread(); t.start(); } } 2.实现Runnable public class TestRunnable…