The raising of the imaginary error flag is simply called raising or ________ an error .
- ACatching
- BCasting
- CThrowing
- DNone of given options
Raising the error flag is called throwing an exception.
MCQs, short and long questions from lecture 35.Lecture 35 ki MCQs, short aur long sawal.
8 MCQs · 2 short questions · 8 MCQs from past papers8 MCQs · 2 short sawal · 8 MCQs past papers se
The raising of the imaginary error flag is simply called raising or ________ an error .
Raising the error flag is called throwing an exception.
The idea behind exception handling is to raise some error flag every time ________ .
An exception is raised whenever something goes wrong.
Exception handling is a powerful technique that separates error-handling code from ______ code.
Exception handling separates error-handling code from the normal code.
The complexity of a program may ______ if there are exceptional paths in it
Exceptional paths add hidden execution paths, which increases complexity.
When an error is thrown the overall system (on the lookout for this error flag) responds by ______ the error .
The system responds to a thrown error by catching it.
A number of invisible execution paths can exist in simple code in a language that allows --------------
Exceptions create hidden execution paths in otherwise simple code.
------------- is a powerful technique that separates error-handling code from normal code.
Exception handling separates error-handling code from the normal code.
Exception handling provides:
Exception handling is a mechanism for handling errors.
No MCQs match this filter.Is filter mein koi MCQ nahi.
What is the greatest advantage of exception handling ?
Its greatest advantage is that it separates error-handling code from the normal code, so the normal logic stays clear and readable while errors are still caught and handled in one place.
Give 2 examples of exceptional code paths.
With exceptions, any call or operator can create a hidden path. For example in if (e.Title() == "CEO" || e.Salary() > 10000) 1) e.Title(), e.Salary() or operator == might throw an exception, leaving the if-statement early; 2) in cout << e.First() << " " << e.Last() << " is overpaid" << endl; any of the << operator calls might throw. Also, passing e by value means the copy constructor might throw.
No long questions added yet.Abhi koi long sawal shamil nahi.