class SimpleException extends Exception { }
class RecommendExc extends RuntimeException {
//рекомендуемые конструкторы
public RecommendExc () { }
public RecommendExc(String message) {
super(message);
}
//... любые другие члены
}
try {
throw new SimpleException();
} catch (SimpleException e) {
System.out.println("caught " + e);
}
throw new RecommendExc("exeption"); //<-Error