1 public class exception {
6 public static void b(int v) throws Exception{
7 throw new Exception("Exception: value="+v);
10 public static void a() throws Exception {
13 } catch (Exception e) {
14 System.out.println(e.getMessage());
16 System.out.println("Caught in a()");
22 public static void c() throws Exception{
26 } catch (Exception e) {
27 System.out.println(e.getMessage());
29 System.out.println("Caught in c(), rethrowing");
36 public static void d() throws Exception{
37 throw new Exception("Exception: value="+4);
40 public static void e() throws Exception{
44 } catch (Exception e) {
45 System.out.println(e.getMessage());
47 System.out.println("Caught in e(), refilling stacktrace and rethrowing");
55 public static void f() throws Exception{
56 System.out.println("Entering f");
57 throw new Exception("Exception: value="+5);
62 public static void main(String args[]){
67 System.out.println(e.getMessage());
71 throw new Exception("3");
74 System.out.println(e.getMessage());
83 System.out.println(e.getMessage());
92 System.out.println(e.getMessage());
98 throw new ClassCastException();
99 } catch (Exception e) {
100 System.out.println(e.getMessage());
104 throw new ClassCastException();