Y

Yatendra Sir • 5.66K Points
Tutor III

Q. What will be output for the following code?

Code:
begin
         
    raise 'Exception Created!'
   
    puts 'After Exception'
   
  rescue    
    puts 'Finally Saved!'
    
retry
end
  • (A) Finally Saved!
  • (B) After Exception
  • (C) Exception Created!
  • (D) Infinite Loop

Explanation by: Yatendra Sir
Be careful while using retry statement because it may result into infinite loop.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.