Viewing code of StupiedThread
// ------ 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!");
}
}
Home
Library Home:
- 1 Addition
- 2 BoxUser
- 3 BoxUser1
- 4 BoxUser2
- 5 Calc
- 6 Check
- 7 Circle
- 8 point
- 9 CircleMain
- 10 Clock
- 11 Compare
- 12 Constant
- 13 raan
- 14 CurentThreadDemo
- 15 sidd
- 16 CurrentThread
- 17 multi
- 18 CurrentThreadDemo
- 19 Driver
- 20 Fact
- 21 sirish
- 22 Factorial
- 23 Factorlial
- 24 FrameAndMenu
- 25 GF
- 26 GUI
- 27 GUITest
- 28 GrandFather
- 29 HariNarayanDemo
- 30 HariNarayanDemor
- 31 HariNayaranDemo
- 32 HariNayaranDemoR
- 33 HelloKU
- 34 HelloUser2
- 35 HelloWorld
- 36 HelloWorld2
- 37 Line
- 38 Line1
- 39 Main
- 40 MainCircle
- 41 MethodsTest
- 42 MyName
- 43 MyName1
- 44 ObjCreator
- 45 Recursion
- 46 Sort
- 47 multi1
- 48 StupidThreadDemoE
- 49 StupiedThread
- 50 StupiedThreadDemo
- 51 notepad
- 52 StupiedThreadDemoE
- 53 Swap
- 54 Symphony
- 55 anABC
- 56 calulation
- 57 creation
- 58 jframe
- 59 modifiedJFrame