Вопрос пользователя:
Ответ нейросети:
public interface Notification {
String getMessage();
String getAdditionalInfo();
}
public interface NotificationSender {
void send(Notification notification);
void send(List<Notification> notifications);
}
public class SmsNotificationSender implements NotificationSender {
@Override
public void send(Notification notification) {
System.out.println("Sending SMS notification:");
System.out.println("Message: " + notification.getMessage());
System.out.println("Additional Info: " + notification.getAdditionalInfo());
}
@Override
public void send(List<Notification> notifications) {
System.out.println("Sending SMS notifications:");
for (Notification notification : notifications) {
System.out.println("Message: " + notification.getMessage());
System.out.println("Additional Info: " + notification.getAdditionalInfo());
}
}
}
public class EmailNotificationSender implements NotificationSender {
@Override
public void send(Notification notification) {
System.out.println("Sending Email notification:");
System.out.println("Message: " + notification.getMessage());
System.out.println("Additional Info: " + notification.getAdditionalInfo());
}
@Override
public void send(List<Notification> notifications) {
System.out.println("Sending Email notifications:");
for (Notification notification : notifications) {
System.out.println("Message: " + notification.getMessage());
System.out.println("Additional Info: " + notification.getAdditionalInfo());
}
}
}
public class PushNotificationSender implements NotificationSender {
@Override
public void send(Notification notification) {
System.out.println("Sending Push notification:");
System.out.println("Message: " + notification.getMessage());
System.out.println("Additional Info: " + notification.getAdditionalInfo());
}
@Override
public void send(List<Notification> notifications) {
System.out.println("Sending Push notifications:");
for (Notification notification : notifications) {
System.out.println("Message: " + notification.getMessage());
System.out.println("Additional Info: " + notification.getAdditionalInfo());
}
}
}
Напишите нам, если в вопросе есть ваши персональные данные ([email protected])
Обратите внимание: ответы, предоставляемые искусственным интеллектом, могут не всегда быть точными. Не рассчитывайте на них в критически важных областях, таких как медицина, юриспруденция, финансы или в вопросах, связанных с безопасностью. Для важных решений всегда обращайтесь к квалифицированным специалистам. Администрация сайта не несет ответственности за контент, сгенерированный автоматически.