Hi All, class MyThread extends Thread{ public void run(){ System.out.println("Done"); } public void demo(){ System.out.println("Demo"); } public static void main(String args[]){ MyThread th=new MyThread(); th.run(); th.stop(); th.demo(); } }
Here , if we try to stop a thread which is not started , should it not give error? Now it compiles and executes.
Here , if we try to stop a thread which is not started , should it not give error? Now it compiles and executes.
Prashant, I am not sure whether you want to know the workings of a stop method. It is deprecated because it does not offer a clean functionality and also it is not on the exam. Hope this helps sri
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss