Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (C) It is used to execute code regardless of whether an exception occurs or not

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
124
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
86%
Success Rate