public class Test4 {
public static void main(String[] args) {
MyThread t1 = new MyThread(1);
MyThread t2 = new MyThread(2);
t1.start();
t2.start();
}
static class MyThread extends Thread {
int num;
public MyThread(int num) {
this.num = num;
}
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println(num);
}
}
}
}



