Build an Interface-Based Notification System
hardQuestion 201Create two classes, EmailNotifier and SmsNotifier, that both implement the provided Notifier interface.
Requirements:
- Notifier declares String send(String message).
- EmailNotifier stores a String email from its constructor. send(message) returns "Email to <email>: <message>".
- SmsNotifier stores a String phone from its constructor. send(message) returns "SMS to <phone>: <message>".
Do NOT write a main method.
Expected output
Email to a@b.com: Hello SMS to 555-1234: Hello
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
InterfacesClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.