1. What will be the output of the program? class Exc0 extends Exception { } class Exc1 extends Exc0 { } / Line 2 / public class Test { public static void main(String args[]) { try { throw new Exc1(); / Line 9 / } catch (Exc0 e0) / Line 11 / { System.out.println("Ex0 caught"); } catch (Exception e) { System.out.println("exception caught"); } } }





Write Comment

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

Tags
Show Similar Question And Answers
QA->If one wants to throw a cricket ball to the maximum distance, then at which angle should he throw it....
QA->If one wants to throw a cricket ball to the maximum distance; then at which angle should he throw it?....
QA->If one wants to throw a cricket ball to the maximum distance, then at which angle should he throw it ?....
QA->There are 50 students in a class. In a class test 22 students get 25 marks each, 18 students get 30 marks each. Each of the remaining gets 16 marks. The average mark of the whole class is :....
QA->Twice World Cup Football winners Argentina sacked their coach on April 10, 2017 after a string of poor results. ? Name that coach?....
MCQ->What will be the output of the program? class Exc0 extends Exception { } class Exc1 extends Exc0 { } / Line 2 / public class Test { public static void main(String args[]) { try { throw new Exc1(); / Line 9 / } catch (Exc0 e0) / Line 11 / { System.out.println("Ex0 caught"); } catch (Exception e) { System.out.println("exception caught"); } } }....
MCQ->What will be the output of the program? public class Test { public static void aMethod() throws Exception { try / Line 5 / { throw new Exception(); / Line 7 / } finally / Line 9 / { System.out.print("finally "); / Line 11 / } } public static void main(String args[]) { try { aMethod(); } catch (Exception e) / Line 20 / { System.out.print("exception "); } System.out.print("finished"); / Line 24 / } }....
MCQ->What will be the output of the program? class s1 extends Thread { public void run() { for(int i = 0; i < 3; i++) { System.out.println("A"); System.out.println("B"); } } } class Test120 extends Thread { public void run() { for(int i = 0; i < 3; i++) { System.out.println("C"); System.out.println("D"); } } public static void main(String args[]) { s1 t1 = new s1(); Test120 t2 = new Test120(); t1.start(); t2.start(); } }....
MCQ->What will be the output of the program? class Happy extends Thread { final StringBuffer sb1 = new StringBuffer(); final StringBuffer sb2 = new StringBuffer(); public static void main(String args[]) { final Happy h = new Happy(); new Thread() { public void run() { synchronized(this) { h.sb1.append("A"); h.sb2.append("B"); System.out.println(h.sb1); System.out.println(h.sb2); } } }.start(); new Thread() { public void run() { synchronized(this) { h.sb1.append("D"); h.sb2.append("C"); System.out.println(h.sb2); System.out.println(h.sb1); } } }.start(); } }....
MCQ->What will be the output of the program? public class X { public static void main(String [] args) { try { badMethod(); System.out.print("A"); } catch (RuntimeException ex) / Line 10 / { System.out.print("B"); } catch (Exception ex1) { System.out.print("C"); } finally { System.out.print("D"); } System.out.print("E"); } public static void badMethod() { throw new RuntimeException(); } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use
DMCA.com Protection Status Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions