|
Written by Aminur Rashid
|
|
Friday, 28 May 2010 |
.
package aminur.gyaan;
/*
* @author aminur ^ nospam.com
*/
public class India extends Thread {
private volatile static int USUAL_TIME = 1000;
private volatile static boolean BAU = true;
public void run() {
while (BAU) {
System.out.println("Keep Running...");
try {
sleep(USUAL_TIME);
} catch (InterruptedException e) {
System.out.println("Damn!! Is it election time...");
}
}
}
/*
* Who said destroy is deprecated :)
*/
public void destroy() {
BAU = false;
}
public static void main(String args[]) {
India india = new India();
india.start();
Thread th = new Thread(india.new Maoist(india));
th.start();
}
class Maoist implements Runnable {
private India india;
Maoist(India india) {
this.india = india;
}
public void run() {
System.out.print("Beep you");
india.destroy();
}
}
}
Add as favourites (18) | Quote this article on your site | Views: 179
Only registered users can write comments. Please login or register. Powered by AkoComment Tweaked Special Edition v.1.4.6 AkoComment © Copyright 2004 by Arthur Konze - www.mamboportal.com All right reserved |