Given below is a Ruby code demonstrating Exception Handling with begin/end block, and rescue clauses.
begin
puts 'This is before the raise.'
raise 'Raising an Error'
puts 'This is after the raise.'
rescue
puts 'This is being rescued'
end
puts 'This is after the begin block.'
What is the output the above code?
Correct Answer:
This is before the raise.
This is being rescued
This is after the begin block.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Ruby MCQ Questions