R
Q. Which of these handles the exception when no catch is used?
S
Q. Which of these methods is used to print stack trace?
Q. Which of these keywords is used to generate an exception explicitly?
V
Q. Which of these clause will be executed even if no exceptions are found?
Q. What will be the output of the following Java code?
class Output { public static void main(String args[]) { try { int a = 0; int b = 5; int c = b / a; System.out.print("Hello"); } catch(Exception e) { System.out.print("World"); } } }
K
Q. What exception thrown by parseInt() method?
Q. A single try block must be followed by which of these?
Q. Which of these methods return description of an exception?
N
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(DevideByZeroException e) { System.out.print("Exception"); } } }
Q. What will be the output of the following Java program?
class exception_handling { public static void main(String args[]) { try { int i, sum; sum = 10; for (i = -1; i < 3 ;++i) sum = (sum / i); } catch(ArithmeticException e) { System.out.print("0"); } System.out.print(sum); } }
....
Jump to Go
Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.
Bootstrap
Embed
WhatsApp
Facebook
Telegram
Share in MCQ Buddy Groups