// Page 225-226 import java.util.Scanner; public class Prog_14_2 { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Wait time: "); int waitTime = input.nextInt(); try { System.out.println("Try block entered."); if(waitTime > 30) { Exception e = new Exception("Time limit exceeded."); throw e; } System.out.println("\nLeave try block.\n\n\n"); } catch (Exception e) { System.out.println("\n\nException: "+ e.getMessage()); System.out.println("Leave catch block.\n\n\n"); } System.out.println("Byebye"); } }