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 (Exception ex)
{
System.out.print("B");
}
finally
{
System.out.print("C");
}
System.out.print("D");
}
public static void badMethod() {}
}

[A] AC
[B] BC
[C] ACD
[D] ABCD
Loading...
Next Question

Overall Stats

Attempted 291
Correct 124
Incorrect 62
Viewed 105

Answers

Guest
Guest
Awa Kone
Awa Kone - 1 month ago

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

ayoub benigmim
ayoub benigmim - 1 month ago

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

Souad El
Souad El - 1 month ago

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

Asmaa Souma
Asmaa Souma - 1 month ago

Asmaa Souma from Khouribga, Morocco is saying BC is correct answer

Cos Sinus
Cos Sinus - 1 month ago

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

Related Questions

parseInt() and parseLong() method throws ________________ ?

  • [A] ArithmeticException
  • [B] ClassNotFoundException
  • [C] NullPointerException
  • [D] NumberFormatException

What happen behind the code int a=50/0;

  • [A] object of exception class thrown
  • [B] Error in code