-
Notifications
You must be signed in to change notification settings - Fork 1
/
TestW1.java
58 lines (46 loc) · 943 Bytes
/
TestW1.java
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
interface I {
int get();
}
public class TestW1 {
public static void main(String[] args) {
I obj1 = new B();
int num1 = obj1.get();
I obj2 = new E();
int num2 = obj2.get();
III obj3 = new C();
int num3 = obj3.get();
int ans = use(num1, num2, num3);
use2(ans);
}
public static int use(int x, int y, int z) {
int t = x + y;
int s = t + z;
return s;
}
public static void use2(int num) {
}
}
interface II extends I{
int get();
}
interface III extends I{
int get();
}
class A implements I{
public int get() {return 1;}
}
class E implements II{
public int get() {return 1;}
}
class D extends E{
public int get() {return 1;}
}
class F extends E{
public int get() {return 1;}
}
class B extends A implements III{
public int get() {return 1;}
}
class C extends B{
public int get() {return 1;}
}