-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqb26,28,29 .java
More file actions
52 lines (39 loc) · 964 Bytes
/
Copy pathqb26,28,29 .java
File metadata and controls
52 lines (39 loc) · 964 Bytes
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
interface a {
int constant_a = 10;
void methoda();
}
interface a1 extends a {
int constant_a1 = 20;
void methoda1();
}
interface a2 extends a {
int constant_a2 = 30;
void methoda2();
}
interface a12 extends a1, a2 {
int constant_a12 = 40;
void methoda12();
}
class B implements a12 {
public void methoda() {
System.out.println("Method a invoked with constant: " + constant_a);
}
public void methoda1() {
System.out.println("Method a1 invoked with constant: " + constant_a1);
}
public void methoda2() {
System.out.println("Method a2 invoked with constant: " + constant_a2);
}
public void methoda12() {
System.out.println("Method a12 invoked with constant: " + constant_a12);
}
}
class Main {
public static void main(String[] args) {
B m = new B();
m.methoda();
m.methoda1();
m.methoda2();
m.methoda12();
}
}