public class myThread extends Thread{
@Override
public void run() {
for (int i = 0; i < 20; i++) {
System.out.println("run" + i);
}
}
}
public class DemoThread {
public static void main(String[] args) {
for (int i = 0; i < 20; i++) {
System.out.println("main" + i);
}
myThread t = new myThread();
t.start();
}
}