blob: 81c083c1c4b51ff3b4bb1517c577322d79eeb0d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package test3;
interface MethodRedirect2SupIntf {
int foo();
int bar();
int bar2();
}
interface MethodRedirect2Intf extends MethodRedirect2SupIntf {
int bar2();
}
class MethodRedirect2SupSup {
public int bfo() { return 100; }
public int bfo2() { return 200; }
}
class MethodRedirect2Sup extends MethodRedirect2SupSup {
public int afo() { return 10; }
public int afo2() { return 20; }
public int bfo() { return 300; }
}
public class MethodRedirect2 extends MethodRedirect2Sup implements MethodRedirect2Intf {
public int foo() { return 1; }
public int bar() { return 2; }
public int bar2() { return 3; }
public int test(MethodRedirect2Intf intf, MethodRedirect2 clazz,
MethodRedirect2SupSup sup)
{
return intf.bar() + intf.bar2() + clazz.afo() + clazz.bfo() + sup.bfo();
}
public int test() {
MethodRedirect2 obj = new MethodRedirect2();
return test(obj, obj, obj);
}
public static void main(String[] args) {
System.out.println(new MethodRedirect2().test());
}
}
|