
How can i write own compile time and runtime exceptions in java

Hello Friend,
Please visit the following links:
http://www.roseindia.net/java/exceptions/how-to-throw-exceptions.shtml
http://www.roseindia.net/java/exceptions/making_custom.shtml
Thanks

Hi Ramesh
whenever we create a class whic is sub class to Exception, those classes treated as compile time exceptions.
public CheckedException extends Exception {
public CheckedException() {}
public CheckedException(String string) {
super(string);
}
}
whenever we create a class whic is sub class to RuntimeException, those classes treated as run time excetions.
public UncheckedException extends RuntimeException { public UncheckedException() {} public UncheckedException(String string) { super(string); } }