Click here to watch in Youtube :
https://www.youtube.com/watch?v=s7rN69ttS0w&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Threads (Thread start twice) |
class DisplayThread extends Thread { public static void main(String args[]) { DisplayThread displayThread = new DisplayThread(); displayThread.start(); displayThread.start(); } public void run() { System.out.println("Hello by = " + this.getName()); } }
Hello by = Thread-0 Exception in thread "main" java.lang.IllegalThreadStateException at java.lang.Thread.start(Thread.java:705) at DisplayThread.main(DisplayThread.java:9)
https://sites.google.com/site/ramj2eev1/home/javabasics/ThreadDemo_start_twice_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/ThreadDemo_start_twice_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/7d3f471503184934dd2cdb3cf35260480f18e932/BasicJava/ThreadDemo_start_twice_App/?at=master
See also:
No comments:
Post a Comment