-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaceDemo.java
More file actions
56 lines (43 loc) · 969 Bytes
/
Copy pathInterfaceDemo.java
File metadata and controls
56 lines (43 loc) · 969 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
53
54
55
56
// interface A {
// public void greeting1();
// }
// interface B {
// public void greeting2();
// }
// class C implements A,B {
// public void greeting1() {
// System.out.println("Hello from 1");
// }
// public void greeting2() {
// System.out.println("Hello from 2");
// }
// }
// public class InterfaceDemo {
// public static void main(String[] args) {
// C obj = new C();
// obj.greeting1();
// obj.greeting2();
// }
// }
interface Line {
public void Line1();
}
interface Polygon extends Line{
public void Polygon1();
public void Line1();
}
class C implements Polygon{
public void Line1() {
System.out.println("Line");
}
public void Polygon1() {
System.out.println("Polygon");
}
}
public class InterfaceDemo {
public static void main(String[] args) {
C obj = new C();
obj.Line1();
obj.Polygon1();
}
}