Defining our own exceptions
Public class Throw_Demo {
public static void main(String[] args) throws Ooops {
Ooops problem = new Ooops(“Alert!”);
throw problem;
// never get here
}
}
class Ooops extends IOException {
Ooops(String message) {
super(message);
}
}
Previous slide
Next slide
Back to first slide
View graphic version