-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTv.java
43 lines (34 loc) · 1.02 KB
/
Tv.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
package kb.design_patterns.adapter;
/* Can eventually extents some Samsung interface */
class SamsumgTv {
public void on() {
System.out.println("Samsung TV is on.");
}
public void off() {
System.out.println("Samsung TV is off.");
}
public void menu() {
System.out.println("Samsung TV menu is opened.");
}
public void connectWifi(String wifiName) {
System.out.println("Samsung TV is connected to WiFi: " + wifiName);
}
public void openYouTubeApp() {
System.out.println("YouTube App is opened.");
}
}
/* Can eventually extents some Sony interface */
class SonyTv {
public void powerOn() {
System.out.println("Sony TV is on.");
}
public void powerOff() {
System.out.println("Sony TV is off.");
}
public void showMenu() {
System.out.println("Sony TV menu is opened.");
}
public void connectToWifiNetwork(String wifiName) {
System.out.println("Sony TV is connected to WiFi: " + wifiName);
}
}