Question: In both C++ and Java, programmers often create special classes for programmer-defined Exceptions. For example, for a project that is doing analysis of word occurrences
In both C++ and Java, programmers often create special classes for programmer-defined Exceptions. For example, for a project that is doing analysis of word occurrences on Subreddits of the site reddit.com, you might create a NoSuchSubreddit exception for the case where the program is trying to access a Subreddit that does not exist. In Java, if you want to look at the code and find out whether a particular class is being used as an exception, it is easy: you see whether it inherits from java.lang.Exception either directly or indirectly. In C++ what do you look for in the code to indicate whether a particular class is used as an exception
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
