Monday, April 30, 2007

What is a user-defined exception?

For every project you implement you need to have a project dependent exception class so that objects of this type can be thrown so in order to cater this kind of requirement the need for user defined exception class is realized.
for example:

class MyException extends Exception{
public MyException(){};
public MyException(String msg){
super(msg);
}

0 comments :

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker