11. Which keyword is used to define an exception class in Ruby? A. exception B. raise C. class D. rescue Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
12. What is the primary purpose of the else keyword in Ruby exception handling? A. To manually raise an exception B. To execute code when no exceptions are raised C. To begin an exception handling block D. To manually raise an exception Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
13. What is the purpose of the retry keyword in Ruby exception handling? A. To begin an exception handling block B. To manually raise an exception C. To retry the operation that caused the exception D. To execute code regardless of whether an exception occurs or not Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
14. What does the ensure keyword do in Ruby exception handling? A. It rescues specific types of exceptions B. It raises an exception C. It defines a new module D. It ensures that a block of code is always executed, regardless of whether an exception is raised or not Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
15. What happens if an exception is raised within an ensure block in Ruby? A. The exception is handled by an outer rescue block, if present B. The program terminates with an error message C. The program continues execution as normal D. The program enters a loop to retry the operation Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
16. Which keyword is used to rescue specific types of exceptions in Ruby? A. catch B. raise C. ensure D. rescue Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
17. Which of the following keywords is used to rescue specific types of exceptions in Ruby? A. ensure B. raise C. rescue D. catch Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
18. What is the purpose of the ensure keyword in Ruby exception handling? A. To define a new module B. To execute code regardless of whether an exception occurs or not C. To create a new instance of a class D. To define a new module Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
19. What is the purpose of the retry keyword in Ruby? A. To begin an exception handling block B. To manually raise an exception C. To retry the operation that caused the exception D. To execute code regardless of whether an exception occurs or not Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
20. What is the purpose of the else keyword in Ruby exception handling? A. To execute code regardless of whether an exception occurs or not B. To manually raise an exception C. To begin an exception handling block D. To execute code when no exceptions are raised Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board