class A { void m1()throws InterruptedException { System.out.println("hello"); } } class B extends A { void m1()throws InterruptedException { for(int i=0;i<5;i++) { Thread.sleep(1000); System.out.println("Welcome"); } } public static void main(String args[]) { B x=new B(); try { x.m1(); }