| Author: Nellaikumar 05 Aug 2008 | Member Level: Gold | Rating: Points: 6 |
Hi Perin,
If you want to show the exception or error, which is familiar or expected, then you can design your condition to receive such values and display the information to the user.
Example, you know that int a is 0, and tried to divide this, then it will arithmetic exception.
In this case, you can validate your input before it attempts to error/exception, then throw/display to the user.
This way, you can achieve your requirement without try and catch.
But this is not advisable, because developer has to handle all kinds of possible exception and errors, which come across. So, proper error handling is important.
|