Java Thread Uygulama

class Thread00 extends Thread {
public void run() {
for (int i = 0; i < 20; i++) {
System.out.println(Thread.currentThread().getName() + " " + i);
}
}
}

class Thread01 extends Thread {
public void run() {
for (int i = 0; i < 20; i++) {
System.out.println(Thread.currentThread().getName() + " " + i);
}
}
}

public class ThreadOrnek01 {

public static void main(String[] args) {
Thread00 th0 = new Thread00();
Thread01 th1 = new Thread01();
th0.start();
th1.start();

}

}

« »