Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
113 / 187
What is meant by exception handling mechanism?
Answer:
Exception handling mechanism is basically built upon through keywords namely try, catch, and throw. The keyword try is used to preface a block of statements which may generate an exception. This block of statements is known as try block. When an exception is detected, it is thrown using a throw statement in the try block. A catch statement is defined by the keyword catch “catches†the exception thrown by the throw statement in the try block.
Asked In ::
Abhilash Singh
23 Feb, 2019 5:07 AM
Exception handling mechanism is basically built upon through keywords namely try, catch, and throw. The keyword try is used to preface a block of statements which may generate an exception. This block of statements is known as try block. When an exception is detected, it is thrown using a throw statement in the try block. A catch statement is defined by the keyword catch “catches†the exception thrown by the throw statement in the try block.