codegen: handle exceptions of a method
[mate.git] / tests / Interface2.java
1 package tests;
2
3 public class Interface2 implements Inf2_I1_local, Inf2_I2_local, Inf2_I3_local {
4         public int x;
5
6         public Interface2() {
7                 this.x = 0x1337;
8         }
9
10         public int func1(int a) {
11                 this.x = a;
12                 return this.x;
13         }
14
15         public int func2(int a, int b) {
16                 return a + b;
17         }
18
19         public int func3(int a, int b) {
20                 return a - b;
21         }
22
23         public static void main(String []args) {
24                 Interface2 o1 = new Interface2();
25                 Inf2_I1_local i1 = o1;
26                 Inf2_I2_local i2 = o1;
27                 Inf2_I3_local i3 = o1;
28                 System.out.printf("this.x: 0x%08x\n", i1.func1(0x1122));
29                 System.out.printf("this.x: 0x%08x\n", i2.func1(0x22));
30                 System.out.printf("this.x: 0x%08x\n", i3.func1(0x33));
31
32                 System.out.printf("func2: 0x%08x\n", i2.func2(0x22, 0x44));
33                 System.out.printf("func2: 0x%08x\n", i3.func2(0x22, 0x44));
34
35                 System.out.printf("func3: 0x%08x\n", i3.func3(0x111, 0x11));
36         }
37 }
38
39 interface Inf2_I1_local {
40         int func1 (int a);
41 }
42
43 interface Inf2_I2_local {
44         int func1 (int a);
45         int func2 (int a, int b);
46 }
47
48 interface Inf2_I3_local extends Inf2_I2_local, Inf2_I1_local {
49         int func1 (int a);
50         int func3 (int a, int b);
51 }