• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package test1;
2 
3 public class TryCatch {
4     int a = 0;
5     String s = null;
6 
init()7     public void init() {
8 	s = "test";
9     }
10 
doit()11     public void doit() {
12 	a = s.length();
13     }
14 
m2()15     public void m2() {}
16 
m1()17     public int m1() {
18 	m2();
19 	return a;
20     }
21 
p1()22     public int p1() {
23 	try {
24 	    return s.length();
25 	}
26 	catch (NullPointerException e) {
27 	    throw e;
28 	}
29     }
30 
run()31     public int run() {
32 	return m1();
33     }
34 }
35