This can be deduced from
Client business requirements
For eg - you are developing a website (
Java Servlet based) for any client.
During design phase of project, we drill down client requirements and try to design the application according to client need.
Let us say that Client requirement is
-->
Require a page to show latest RSS Feeds from Yahoo News. In case Yahoo Feed is not available then use Google News Feed.
Now with this requirement in mind, we can design our Exception hierarchy.
So I will make following
checked exception --> YahooFeedsNotFoundException (extends Exception)
Suppose I made a class (say - FetchFeed) which have two static methods - displayYahooFeeds() and displayGoogleFeeds()
displayYahooFeeds() method throws YahooFeedsNotFoundException exception when Yahoo Feeds are not available due to any reason (for eg - feed not available, network connectivity down, network time out, feed url incorrect etc)
Now i have another class (say - DisplayFeed) which one method - displayAppropriateFeed()
Sample code inside this displayAppropriateFeed() method can be
Here, YahooFeedsNotFoundException is an checked exception because our application can overcome this error (error of not finding yahoo feed) by displaying Google Feeds instead.
I hope I have made my self clear and given you a basic understanding of statement -
we make checked excpetions when we expect client to recover from that exception