JAVA-CustomException
package exception;
class CustomException extends Exception{
public CustomException(){
super("自訂例外");
}
public CustomException(String msg){
super(msg);
}
}
public class TestCustomException{
public static void main(String [] args){
try{
throw new CustomException();
}catch (CustomException ce ){
ce.printStackTrace();
}
}
}

Gut!