-
Notifications
You must be signed in to change notification settings - Fork 0
/
InterfaceTask1.java
56 lines (47 loc) · 1022 Bytes
/
InterfaceTask1.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
interface camera{
void click();
void record();
}
interface MusicPlayer{
void play();
void stop();
}
class Phone{
void call(){
System.out.println("Calling!!");
}
void sms(){
System.out.println("Sending Sms!!");
}
}
class SmartPhone extends Phone implements MusicPlayer , camera{
void call(){
super.call();
}
void sms(){
super.sms();
}
public void click(){
System.out.println("Clicked!!");
}
public void record(){
System.out.println("Recording!!");
}
public void play(){
System.out.println("Music is Playing!!");
}
public void stop(){
System.out.println("Stop Music!!");
}
}
public class InterfaceTask1 {
public static void main(String args[]){
SmartPhone sp = new SmartPhone();
sp.click();
sp.record();
sp.play();
sp.stop();
sp.sms();
sp.call();
}
}