Write a java program to display message a 2sec time gap without using Multi Threading

Write a java program to display message a 2sec time gap without using Multi Threading

Program
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        int x;
        try
        {
            for(x=1;x<=10;x++) 
            {
                Thread.sleep(2000);
                System.out.println("Hello Sateesh");
            }
                	
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}


Output:

Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh
Hello Sateesh


Strings Handling In Java



More Questions


211 . Write a Java-program to Count the number of vowels in a given string ?
212 . Write a Java-program to Count the number of Consonants in a given string ?
213 . Write a Java-program to Count the number of spaces in a given string
214 . Write a Java-program to Count the number of special characters in a given string ?
215 . Write a Java-program to Count the number of letters in a given string ?
216 . Write a Java-program to Count the number of Numbers in a given string ?
217 . Write a Java-program to Remove vowels in a given string ?
218 . Write a Java-program to Remove consonants in a given string ?
219 . Write a Java-program to Remove special characters in a given string ?
220 . Write a Java-program to Remove spaces in a given string ?
221 . Write a Java-program to Remove letters in a given string ?