Home / Programming MCQs / Ruby MCQs / Question

Y

Yatendra Sir • 5.66K Points
Tutor III

Q. What will be output for the following code?

Code:
begin
         
    puts 'no Exception raise' 
  
    rescue    
        puts 'Finally Saved!'
  
   else
        puts 'Else block execute because of no exception raise'
       
   ensure
      puts 'ensure block execute'
end
(A) no Exception raise Else block execute because of no exception raise ensure block execute
(B) no Exception raise Else block execute because of no exception raise
(C) Finally Saved! Else block execute because of no exception raise ensure block execute
(D) None of the above

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.