MSK Technologies

Home
Practice Programs
Java Programs Python Programs Java Quiz
Pages
Python Java Material PLSQL Material
Search A Job

Write a Thread sleep() program

  1. Home
  2. Java Programs

Write a Thread sleep() program

Write a Thread sleep() program

Program
class ThDemo  extends Thread
{
    public void run()  
    {    
        int x;
        for(x=1;x<=10;x++)
        {
            try
            {
                Thread.sleep(2000);
                System.out.println(x);
            }
            catch(Exception e)
            {
                System.out.println(e);
            }
        }
    }   
    
}
public class Main
{
    public static void main(String args[])
    {
        ThDemo d1=new ThDemo();
        d1.start();
    }
}


Output:

1
2
3
4
5
6
7
8
9
10


Multi Threading In Java



More Questions


222 . Write a Java-program to Remove numbers in a given string ?
223 . Write a Java-program to print duplicate characters from the string ?
224 . Write a Java-program to print unique(distinct (or non-repeating characters) ) characters from the string ?
225 . Write a java program How to check if two strings are anagrams of each other?
226 . How to reverse a string in Java without using the reverse method ?
227 . How to count the occurrence of the given character in a string?
228 . How to check if a string is a palindrome?
229 . How to count the number of words in a given string sentence?
230 . How to reverse the words from the given string sentence?
231 . How to swap two strings without using the third variable?
232 . Write a java program to display message a 2sec time gap without using Multi Threading


Interview Questions

Java Interview Questions

Python Interview Questions

Oracle Interview Questions

100 Most Asked Java Interview Questions and Answers

HR Interview Questions and Answers

Top 50 OOPS Interview Questions & Answers

Apply For The Job

Apply For Job

Java Material

Python Material

PLSQL Material

.Net Material

Java Practice Programs

400 Java Programs

Java Practice Programs

Write a Java program to check whether Java is installed on your computer or not

Write a Java program to compare two numbers

Write a Java program to compute the sum of the first 100 prime numbers

Write a Java program to count the number of even and odd elements in a given array

Write a Java program to print the sum of two numbers

Python Practice Programs

Write a python program to counting item occurrences

Write a python program to checking internet speed

Write a python program to checking if a string is empty or not ?

Write a Python program to get current time and date

Write a python program to display list of numbers and we want to return all the numbers from the list that are divisible by 2 and remove duplicates at the same time.

Interview Questions

Java Interview Questions

Python Interview Questions

Oracle Interview Questions

100 Most Asked Java Interview Questions and Answers

HR Interview Questions and Answers

Top 50 OOPS Interview Questions & Answers

Java Quiz

Java Quiz - 3

Java Quiz - 14

Java Quiz - 23

Java Quiz - 8

Java Quiz - 2

Courses
Java Python PLSQL .Net ADO.Net About Us
Quick Links
Daily Use English Sentences Daily General Knowledge General Knowledge Latest Update Inventions and Inventors జనరల్ నాలెడ్జ్ General Knowledge Spoken English Spoken Hindi GK Hindi Telugu Facts Unknown Facts Psychology Facts Motivation Quotes విటమిన్ - సి,డి,ఇ,కె Android
Spiritual
రాధాకృష్ణ భగవద్గీత Motivation Quotes Slokas Talapatra Nidhi ఆధ్యాత్మిక భక్తి ప్రపంచం Sadhguru Sai Motivation Quotes గౌతమ బుద్ధుడు Bhagavad Gita Quotes
Newsletter

Dolor amet sit justo amet elitr clita ipsum elitr est.

© sateeshm, All Right Reserved. Designed By sateeshm
Home Help FQAs