

MCQOPTIONS
Saved Bookmarks
1. |
What is the output of this program? class Myexception extends Exception { int detail; Myexception(int a) { detail = a; } public String toString() { return "detail"; } } class Output { static void compute (int a) throws Myexception { throw new Myexception(a); } public static void main(String args[]) { try { compute(3); } catch(Exception e) { System.out.print("Exception"); } } } |
A. | 3 |
B. | Exception |
C. | Runtime Error |
D. | Compilation Error |
Answer» C. Runtime Error | |