Monday, 13 February 2017

UnCheckedException : IllegalMonitorStateExcept




public class IllegalMonitorStateExcept {


    public static class ThreadDemo extends Thread {

        public void run() {
            try {
                wait();            }
            catch (InterruptedException e) {}
            System.out.println("Hello from thread");        }

        public static void main(String[] args) {

            new ThreadDemo().start();
        }

    }
}

No comments:

Post a Comment