1package com.beginner.examples;
2
3import java.util.Date;
4
5public class DelayRun {
6
7 public static void main(String[] args) {
8
9 System.out.println("It is : " + new Date());
10 try {
11 Thread.sleep(4000); // delay few seconds
12 System.out.println("It is : " + new Date());
13 } catch (InterruptedException e) {
14 e.printStackTrace();
15 }
16 }
17}
18Copy