123456789101112131415161718 |
- public class TestThread {
- public static void main(String[] args) {
- MyThread thread = new MyThread();
- thread.start();
- }
- }
- class MyThread extends Thread {
- @Override
- public void run() {
- try {
- Thread.sleep(1000);
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println("Finished.");
- }
- }
|