-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCH_11_Interferances_and_Default_Methods.java
More file actions
49 lines (43 loc) · 1.08 KB
/
Copy pathCH_11_Interferances_and_Default_Methods.java
File metadata and controls
49 lines (43 loc) · 1.08 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
interface MyCamera{
void snap();
void takeVideo();
private void Greet(){
System.out.println("Welcome");
}
default void Take4kVideo(){
Greet();
System.out.println("Taking 4K Video");
}
}
interface wifi{
String [] takeNetwork();
}
class MycelPhone{
void call(){
System.out.println("calling");
}
}
class MySmartPhone extends MycelPhone implements MyCamera,wifi{
public void snap(){
System.out.println("Taking Snap");
}
public void takeVideo(){
System.out.println("taking Video");
}
public String[] takeNetwork(){
System.out.println("Checking wifi");
String[] Network={"TpLink", "Atharva", "wifi001", "TpLink00"};
return Network;}
// public void Take4kVideo(){
// System.out.println("4K");
}
public class CH_11_Interferances_and_Default_Methods {
public static void main(String[] args) {
MySmartPhone aa =new MySmartPhone();
String[] ms =aa.takeNetwork();
for (String bb: aa.takeNetwork()){
System.out.println(bb);
}
aa.Take4kVideo();
}
}