-
Notifications
You must be signed in to change notification settings - Fork 148
/
Whatsapp.java
47 lines (40 loc) · 830 Bytes
/
Whatsapp.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
public class Whatsapp {
public static void main(String[] args) {
Audiiocall a = new Audiiocall();
videocall v = new videocall();
a.call();
a.mute();
a.decline();
v.call();
v.mute();
v.decline();
}
}
interface WhatsappCalls{
//abstract methods only
void call();
void mute();
void decline();
}
class Audiiocall implements WhatsappCalls{
public void call() {
System.out.println("whatsapp audiocall");
}
public void mute() {
System.out.println("audiocall muted");
}
public void decline() {
System.out.println("audiocall declined");
}
}
class videocall implements WhatsappCalls{
public void call() {
System.out.println("whatsapp videocall");
}
public void mute() {
System.out.println("videocall muted");
}
public void decline() {
System.out.println("videocall declined");
}
}