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();
        }
    }

}