import java.io.IOException;
import java.util.Random;
public class TestThreada {
public static void main (String [] args) {
Thread myThread = new MyThread ();
System.out.println ("Erst Mal ein Hallo");
myThread.start();
for (int i = 0; i < 40000; i++);
myThread.stop();
}
public static class MyThread extends Thread {
@Override
public void run () {
System.out.println ("Hallo");
System.out.println ("Hallo zum Zweiten");
while (true)
System.out.println ("Hopefully we stop");
}
}
}