// file Thread.java
1. package ThreadTest;
2. public class Thread implements Runnable {
3.     public void run() {
4.         System.out.println("thread");
5.     }
6. }
// file Thread2.java
10. package ThreadTest;
11. public class Thread2 implements Runnable {
12.     public void run() {
13.         System.out.print("thread2");
14.     }
15.     public static void main(String[] args) {
16.         Thread2 thread = new Thread2();
17.         Thread t1 = new Thread(thread);
18.         t1.start();
19.     }
20. }
Login in to like
Login in to comment