English, asked by sidsavale8511, 4 months ago

Find Output: class A { public static void main(String
args[]) { try { int a, b; b = 0; a = 5/b;
System.out.print("A"); } catch(ArithmeticException e) {
System.out.print("B"); }}}
Answer:
B
O Compilation Error
Runtime Error
O
ОА​

Answers

Answered by venugopalkumar74
1

Answer:

Overview

Java Programming MCQ Questions - Exception Handling

11. What is the output of this program?

class Main

{

public static void main(String args[])

{

try

{

System.out.print("Hello" + " " + 1 / 0);

}

catch(ArithmeticException e)

{

System.out.print("World");

}

}

}

A. Hello

B. World

C. HelloWorld

D. Hello World

View Answer

12. What is the output of this program?

class Main

{

public static void main(String args[])

{

try

{

int a, b;

b = 0;

a = 5 / b;

System.out.print("A");

}

catch(ArithmeticException e)

{

System.out.print("B");

}

}

}

A. A

B. B

C. Compilation Error

D. Runtime Error

View Answer

Similar questions