import java.io.*; class A { void display()throws InterruptedException { System.out.println("black"); } } class B extends A { void display()throws InterruptedException { Thread.sleep(1000); System.out.println("white"); } public static void main(String[] args) { A a=new B(); try { a.display(); } catch(InterruptedException e) {} } }