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) |
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); } } }
Hello good morning Did you eat I am going to walk Good nightClick 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:
No comments:
Post a Comment