Click here to watch in Youtube :
Click the below Image to Enlarge
Java Tutorial : Java Threads (How to create a thread in java | Thread creation in java) |
Java Tutorial : Java Threads (How to create a thread in java | Thread creation in java) |
class DisplayThread extends Thread { public static void main(String args[]) { /* * Allocates a new Thread object. */ DisplayThread displayThread = new DisplayThread(); /* * Causes this thread to begin execution; the Java * Virtual Machine calls the run method of this * thread */ displayThread.start(); } /* * Subclasses of Thread should override run() method. */ @Override public void run() { System.out.println("Welcome to india"); } }Output
Welcome to indiaRefer:
https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/Thread.html
https://sites.google.com/site/ramj2eev1/home/javabasics/Thread_create_ex_thread_app.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/Thread_create_ex_thread_app
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/5edb9b935a4ef60d2a672d03f038390cd08d4eb7/BasicJava/Thread_create_ex_thread_app/?at=master
See also:
No comments:
Post a Comment