What is the result?

Report a typo

Look at the code below. What is the result of invoking the main method?

class Main {
    public static void main(String... args) {
        Speaker speaker = new Speaker();
        speaker.notify();
    }
}

class Speaker implements Notification, Alarm {
}

interface Notification {
    default void notify() {
        System.out.println("Hello World!");
    }
}

interface Alarm {
    default void notify() {
        System.out.println("Attention");
    }
}
Select one option from the list
___

Create a free account to access the full topic