MCQs > IT & Programming > Ruby > 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?

Ruby MCQs

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?

Answer

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

Ruby Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Ruby Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it