Holding Java Program for some time during execution



hold terminal screen logo


Hello friends, Welcome to programming scoop. Today  i will tell you how you can hold the program for some time during execution. In many types of program we require to hold the screen for some time before executing another task.

Code:- 

For holding program concept of Threading is used where a sleep is method is used to sleep the program for some time same process we will use to hold the program.

For doing this you have to include the following code in your program.

  1. /*****  it will hold the program for some time **************/
  2. try
  3. {
  4.     Thread.sleep(70);    //for holding program
  5.    
  6. }
  7. catch(Exception e)
  8. {
  9. }

Here 70 is in millisecond it means the program will sleep or hold the screen for 70 millisecond then start automatically you can give the time according to your program.

You can see the programs related to it by clicking here.
Follow and share the post to your friends so they can also learn things easily. and also comment your query and which type of program of concept you want me to explain. have a nice day.