Vidyalelo
Ruby Programming · Q7

Exception Handling in Ruby

Programming · Ruby Programming · question 7

Q7

What is the purpose of the ensure keyword in Ruby?

A.
To create a new instance of a class
B.
To define a new module
C.
To execute code regardless of whether an exception occurs or not
Answer
D.
To handle exceptions and execute alternative code paths

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board