forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdmiral.java
More file actions
22 lines (18 loc) · 608 Bytes
/
Admiral.java
File metadata and controls
22 lines (18 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package Observer;
public class Admiral implements Subscriber {
String name;
public Admiral(String name) {
this.name = name;
}
@Override
public void getAlarm(String alarm) {
System.out.println(name + " Получил сообщение от смотрителя: " + alarm);
System.out.println("Нахрена вы мне это прислали... около смотровой башни нет моря...");
}
@Override
public String toString() {
return "Admiral{" +
"name='" + name + '\'' +
'}';
}
}