πŸ“Š Ruby
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) Infinite Loop

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
186
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Yatendra Sir
Publisher
πŸ“ˆ
88%
Success Rate