Click here to watch in Youtube :
https://www.youtube.com/watch?v=xegC8gte6ro&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation) |
public class HelloRunnable implements Runnable { public static void main(String args[]) { HelloRunnable helloRunnable = new HelloRunnable(); Thread thread = new Thread(helloRunnable); thread.start(); } @Override public void run() { System.out.println("Hello from a thread!"); } }Output
Hello from a thread!
HelloThread.javapublic class HelloThread extends Thread { public static void main(String args[]) { HelloThread helloThread = new HelloThread(); helloThread.start(); } @Override public void run() { System.out.println("Hello from a thread!"); } }
Click the below link to download the code:OutputHello from a thread!
https://sites.google.com/site/ramj2eev1/home/javabasics/Thread_create_two_ways_app.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/Thread_create_two_ways_app
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/5edb9b935a4ef60d2a672d03f038390cd08d4eb7/BasicJava/Thread_create_two_ways_app/?at=master
See also:
No comments:
Post a Comment