Q. What does the `finally` block do?

  • (A) Runs only if an exception occurs
  • (B) Runs only if no exception occurs
  • (C) Runs whether or not an exception occurs
  • (D) Skips all errors
πŸ’¬ Discuss
βœ… Correct Answer: (C) Runs whether or not an exception occurs
Explanation: `finally` block always executes, regardless of an exception.
Explanation by: Mr. Dubey
`finally` block always executes, regardless of an exception.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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