ExamVeda
Login
Home
This question belongs to Java Program Exceptions
Exceptions
?

What is the output of the following program code?
public class Test{
        public static void main(String args[]){
                try{
                        int i;
                        return;
                }
                catch(Exception e){
                        System.out.print("inCatchBlock");
                }
                finally{
                        System.out.println("inFinallyBlock");
                }
        }
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Sourodeep Chatterjee
Sourodeep Chatterjee 9 years ago
Here, no exception is occurring which we have to handle, that's why catch block isn't executing but we all know, whether an exception is caught or not, finally always executes, so all the statements inside of finally block occurs