Stuff
public text v1 · immutablepublic class Example1 {
public static void main(String[] args) {
MyThread t1 = new MyThread("A");
MyThread t2 = new MyThread("B");
MyThread t3 = new MyThread("C");
t1.start();
t2.start();
t3.start();
}
}
class MyThread extends Thread {
private String message = "Hallo!";
public MyThread() {}
public MyThread(String s) {message = s;}
public void run() {
for (int i = 1; i <= 5; i++) {
System.out.print(message);
}
}
}