User-defined Exceptions

Posted on Updated on

Java provides many built-in exception but at many times built-in exceptions are not able to describe a certain situation. In such cases, like the built-in exception, the programmer can also create his own exception which are called user-defined exception.

Read the rest of this entry »

Java – Exception Handling

Posted on Updated on

Stuff happens. The file isn’t there. The server or database is down. No matter how good a programmer you are, you can’t control everything. Things can go wrong, very wrong. When you write a risky method, you need to handle the bad things that might happens. But how do you know when a method is risky and when do you put the code to handle the exception situation? Read the rest of this entry »