Wednesday 14 December 2016

Java Tutorial : Java Threads (Thread Sleep | Thread sleep in java_V2)


Click here to watch in Youtube :
https://www.youtube.com/watch?v=KkptpME8Mpo&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java Threads (Thread Sleep | Thread sleep in java_V2) 
SleepMessages.java
public class SleepMessages
{
    public static void main(String args[]) throws InterruptedException
    {
        String messages[] =
        { "Hello good morning", "Did you eat", "I am going to walk",
                "Good night" };

        for (String message : messages)
        {
            // Pause for 5 seconds
            Thread.sleep(5000);
            // Print a message
            System.out.println(message);
        }

    }
}
Output
Hello good morning
Did you eat
I am going to walk
Good night
Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/ThreadDemo_sleep_pause_App.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/ThreadDemo_sleep_pause_App

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/7d3f471503184934dd2cdb3cf35260480f18e932/BasicJava/ThreadDemo_sleep_pause_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