MCQ Single Best Answer Not Set

QWhat will be the result of executing the following code?
public class Test{
      public void divide(int a, int b){
            try{
	          int c = a / b;
   	    }catch(Exception e){
	          System.out.print("Exception ");
  	    }finally{
	          System.out.println("Finally");
      }

      public static void main(String args[]){
            Test t = new Test();
            t.divide(0,3);
      }
}

ID: #2331 Java Exception MCQ 4,592 views
Question Info
#2331Q ID
Not SetDifficulty
Java Exception MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Prints out: Exception
  • B Prints out: Exception Finally
  • C Compile with error
  • D Prints out: Finally
Correct Answer: Option C

Explanation

Prints out: Finally

Share This Question

Challenge a friend or share with your study group.