CJCoding With Joseph
15free / daySign inCreate account

Alarm gives ring() a default body that returns Beep. A class that implements Alarm may keep that default, the way QuietAlarm does with an empty body, or replace it with its own version. Make LoudAlarm replace it.

Requirements: 1. Override ring() in LoudAlarm so it returns BEEP BEEP. 2. The override must be public and have the same name, return type and empty parameter list as the method in the interface. 3. Do not change Alarm or QuietAlarm. A QuietAlarm must still return the default.

Do NOT write a main method.

Expected output

BEEP BEEP
Beep

= newline. The output ends with a newline, so print one after the last line.

Hints3 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.