package aminur.gyaan; /* * @author info^_nospam_^@aminurrashid.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(); } } }
Related posts
Feed
- India
- World
- Live
- Cricket News
Popular
- Allama Iqbal – Sele... 42.3k views
- Harappan Culture (Indus V... 26.6k views
- Allama Iqbal – Sele... 20.8k views
- Bhagalpur to Singapore 17.3k views
- Islamic Banking? Whats th... 16.5k views
- Beach Trek Across Arabian... 14.8k views
- Sach hai, Vipatti jab aat... 12.4k views
- I Protest 10.4k views
- O ye who don’t beli... 10k views
- Thread unsafe Format in J... 6.5k views
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