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(); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter