Q: What will happen when a programs throws any other type of exception other than specified?
Solution: Because there is no way defined to catch that exception and as we know if an exception is not caught then error arises.
Q: What do you mean by “No exception specification”?
Solution: No exception specification that it can throw anything.
Q: Which operations don’t throw anything?
Solution: Operations which are irreversible cannot throw anything.
Q: What happens if try catch block is not used?
Solution: If try catch block is not used the exception thrown by the program will be uncaught hence will result into error(s).
Q: Which handler is used to handle all types of exception?
Solution: To catch all types of exceptions, we use the catch-all handler.
Q: Which operator is used as catch-all handler?
Solution: The ellipses operator can be represented as (…).
Q: What function will be called when we have an uncaught exception?
Solution: If we have an uncaught exception means, the compiler will throw the control of the program to terminate function.
Q: What will not be called when the terminate() is raised in the constructor?
Solution: To free the memory occupied by that object during initializing and destroy that object.
Q: What will happen when we move to try block far away from catch block?
Solution: compilers may try to move the catch-code far away from the try-code, which reduces the amount of code to keep in cache normally, thus enhancing performance.
Q: What will happen if an exception that is thrown may cause a whole load of objects to go out of scope?
Solution: It will be added to the overhead if an exception that is thrown may cause a whole load of objects to go out of scope.
You Have Score    | /10 |