-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_59.java
More file actions
54 lines (54 loc) · 1.31 KB
/
Main_59.java
File metadata and controls
54 lines (54 loc) · 1.31 KB
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
interface Camera2{
void takePhoto();
void recordVideo();
private void quality(){
System.out.println("set quality");
}
default void takePortrait(){
quality();
System.out.println("click portrait");
}
}
interface Wifi2{
String[] getNetwork();
void connect(String network);
default void error(){
System.out.println("no connection");
}
}
class Cellphone2{
void call(int number){
System.out.println("calling "+number);
}
void pick(){
System.out.println("connecting");
}
}
class Smartphone2 extends Cellphone2 implements Wifi2, Camera2{
public void takePhoto() {
System.out.println("take picture");
}
public void recordVideo(){
System.out.println("record video");
}
public String[] getNetwork(){
System.out.println("setting network");
String[] list={"airtel", "bsnl"};
return list;
}
public void connect(String network) {
System.out.println("connect to"+network);
}
public void error() {
System.out.println("no internet");
}
}
public class Main_59 {
public static void main(String[] args) {
Camera2 cam=new Smartphone2();
cam.takePhoto();
Smartphone2 s=new Smartphone2();
s.call(98765457);
s.error();
}
}