Examveda
Examveda

Which of the following is true about the ensure keyword in Ruby exception handling?

A. It is used to define a new module

B. It is used to create a new instance of a class

C. It is used to execute code regardless of whether an exception occurs or not

D. It is used to add module methods to a single object

Answer: Option C


This Question Belongs to Ruby Programming >> Exception Handling In Ruby

Join The Discussion

Related Questions on Exception Handling in Ruby

What is an exception in Ruby?

A. A way to group related methods and constants

B. A method for defining variables

C. An unexpected event that disrupts the normal flow of the program

D. A predefined object in Ruby