package aminur.gyaan; 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..."); } } } 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(); } } }
Related posts
Feed
- India
- World
- Live
- Cricket News
This site uses cookies. These cookies come mainly from third party library used at this site(Google/Jetpack/etc). By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here Cookie Policy
To find out more, including how to control cookies, see here Cookie Policy