5 years ago in Java Exception Handling

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();
}
}

[A] BD
[B] BCD
[C] BDE
[D] BCDE
Loading...
Next Question

Overall Stats

Attempted 324
Correct 116
Incorrect 82
Viewed 126

Answers

Guest
Guest
Awa Kone
Awa Kone - 1 month ago

Awa Kone from Berrechid, Morocco is saying BCDE is correct answer

ayoub benigmim
ayoub benigmim - 1 month ago

ayoub benigmim from Casablanca, Morocco is saying BDE is correct answer

Souad El
Souad El - 1 month ago

Souad El from Casablanca, Morocco is saying BDE is correct answer

Salwa Nouamani
Salwa Nouamani - 1 month ago

Salwa Nouamani from Casablanca, Morocco is saying BDE is correct answer

Cos Sinus
Cos Sinus - 1 month ago

Cos Sinus from Casablanca, Morocco is saying BDE is correct answer

Related Questions

Which method is used to print the description of the exception?

  • [A] printStackTrace()
  • [B] printExceptionMessage()
  • [C] printStackMessage()
  • [D] printExceptionTrace()