public class PauseExecution {
public static void main(String[] args) {
System.out.println("Pause for 5 seconds...");
try {
// Pause execution for 5000 milliseconds (5 seconds)
Thread.sleep(5000);
} catch (InterruptedException e) {
// Handle the exception if the thread is interrupted
e.printStackTrace();
}
System.out.println("Execution resumes.");
}
}
/*
run:
Pause for 5 seconds...
Execution resumes.
*/