This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In the above code, developer only wrote a wrong syntax and he only handled the Arithmetic Exception. Why to write irrelevant code we can remove those lines of code instead of handling the exception with try and catch.
The above program was developed because he(the developer) wanted to explain the concept of exception handling.
Many times the user would not be giving value himself, and at that time this concept may come to help.