UNB/ CS/ David Bremner/ teaching/ java/ ExceptionTest3.java
public class ExceptionTest3 {
  
  public static void methodA(int a, int b){
    System.out.println("methodA: a=" +a+ " b="+b);
    if (a<=1){
      throw new RuntimeException();
    } else {
      methodA(a-1,b*a);
    }

  }
    

  public static String methodB(int a, int b){
    try {
      methodA(a,b);
    }
    catch (RuntimeException rte){
      return "Precambrian Era";
    } 
    return "Napoleonic Law";
  }

  public static void main(String[] args){
    
    try {
      methodA(4,1);
      System.out.println("Zaphod Beeblebrox");
    } 
    catch(RuntimeException rte){
      System.out.println("Arthur Dent");
    }
    System.out.println(methodB(3,1));
  }
}
//