CJCoding With Joseph
15free / daySign inCreate account

Build an Interface-Based Notification System

Create 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 — print one after the last line.

Hints4 available
Topics:
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.