forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneral.java
More file actions
22 lines (18 loc) · 544 Bytes
/
General.java
File metadata and controls
22 lines (18 loc) · 544 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 General implements Subscriber {
String name;
public General(String name) {
this.name = name;
}
@Override
public void getAlarm(String alarm) {
System.out.println(name + " Получил сообщение от смотрителя: " + alarm);
System.out.println("Сейчас вышлю подкрепление!");
}
@Override
public String toString() {
return "General{" +
"name='" + name + '\'' +
'}';
}
}