Wednesday, 30 November 2016

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

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) 
DisplayThread.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 india
Refer: 
https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/Thread.html

Click the below link to download the code:
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:

  • 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

    Google+ Followers

    Google+ Badge