Friday, 2 December 2016

Java Tutorial : Java Threads (How to create a thread in java | Java thread Creation)


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) 
HelloRunnable.java
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.java
public 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!");
    }

}
Output
Hello from a thread!
Click the below link to download the code:
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:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • No comments:

    Post a Comment