[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C++ Programming :: Functions - Discussion

Home > C++ Programming > Functions > MCQs Questions Discussion

6 / 14

Choose the correct option.

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

Answer: Option (Login/Signup)

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 ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here