C++ Programming :: Functions - Discussion
6 / 14
When an object-oriented program detects an error within a function, the function
Athrows an exception
Bthrows a fit
Ccatches a message
Dcatches an exception
Show Explanation
try: is a block of statements that may throw an exception.
catch: is a block of statements that gets called when a exception is thrown.
throw: can be used to throw an exception.
So when an object-oriented program detects an error within a function, the function throws an exception and catch block if implemented catches the exception, if not the exception will be propagated to the caller function.
Asked In ::
Basic exception handling mechanism in OOP language is like below.
try: is a block of statements that may throw an exception.
catch: is a block of statements that gets called when a exception is thrown.
throw: can be used to throw an exception.
So when an object-oriented program detects an error within a function, the function throws an exception and catch block if implemented catches the exception, if not the exception will be propagated to the caller function.
Read Full Answer
Report Error
Please Login First Click Here