User defined exception
by , 01-08-2012 at 12:01 PM (852 Views)
You can customize and write your own user defined exceptions. Following class extends the Exception class and writes a new “MyException” which is thrown at some point in your code.
Java Code: This is an example of user defined exceptionpublic class MyException extends Exception { /* class definition of constructors goes here */ public MyException() { super(); } public MyException (String errorMessage) { super (errorMessage); } }









Email Blog Entry
License4J 4.0
Today, 12:23 AM in Java Software