SE450
:
Thread Example
[6/36]
Run two threads in parallel
Each thread prints 10 greetings
for (int i = 1; i <= 10; i++)
{
System.out.println(i + ": " + greeting);
Thread.sleep(100);
}
After each printout, sleep for 100 millisec
All threads should occasionally yield control
sleep
throws
InterruptedException