Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void testValue(int i) throws SmallException, BigException {
- if(i < 5) {
- throw new SmallException("Value was lower than 5.");
- } else if(i > 10) {
- throw new BigException("Value was higher than 10.");
- }
- }
- static void printErrorReport(Exception e) {
- System.out.println(e.getMessage());
- }
- }
- class SmallException extends Exception{
- public SmallException(String s) {
- super(s);
- }
- }
- class BigException extends Exception{
- public BigException(String s) {
- super(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement