1System.out.println("Hi");
2//Now it will pause
3try{
4 Thread.sleep(5000)//Time in milliseconds->5000==5 seconds
5 //^freezes whole program for amount of time
6 System.out.println("Hola");//Appears after 5 seconds
7}
8catch(InterruptedException e){
9 System.err.println(e.getMessage());
10}