Programming Language › Java Exception MCQ › Question #2331
Single Choice 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,639 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

Explanation

Prints out: Finally
Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue Programming Language where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.