Viewing code of StupiedThread
// ------ ../cgi-bin/java/StupiedThread.java --------------
//--- Programmed By Rajesh -----

class StupidThread extends Thread{
private String word;
StupidThread(String word) {
this.word = word;
}

public void run() {
for(int i = 0; i <5; ++i) {
System.out.println(word);
try {
sleep(1000);
}
catch(InterruptedException e) {
System.out.println("I am gonna get angry!");
}
}
}
}

public class StupidThreadDemoE {
public static void main( String args[]) {
StupidThread fat = new StupidThread("I want to eat!");
StupidThread thin = new StupidThread("I dont want to eat!");
fat.start();
thin.start();
try {
fat.join();
thin.join();
}
catch(InterruptedException e){}
System.out.println("Thanks god those stupids are gone!");
}
}