Skip to content
Related Articles

Related Articles

C++ | Exception Handling | Question 2
  • Last Updated : 29 Jul, 2020

What is the advantage of exception handling ?

  1. Remove error-handling code from the software’s main line of code.
  2. A method writer can chose to handle certain exceptions and delegate others to the caller.
  3. An exception that occurs in a function can be handled anywhere in the function call stack.

(A) Only 1
(B) 1, 2 and 3
(C) 1 and 3
(D) 1 and 2


Answer: (B)

Explanation: Advantage of exception handling are :-

  1. Remove error-handling code from the software’s main line of code.
  2. A method writer can chose to handle certain exceptions and delegate others to the caller.
  3. An exception that occurs in a function can be handled anywhere in the function call stack.
  4. Separating Error-Handling Code from “Regular” Code.
  5. Propagating Errors Up the Call Stack.


Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :