Resolve a diamond problem

Report a typo

Resolve a diamond problem of ConsoleWriter class. Override greeting method according to Printer interface implementation. Try to avoid code duplication.

Write a program in Java 17
class ConsoleWriter implements Printer, Notifier {
// override greeting method according to Printer default implementation
}

interface Printer {
default void greeting() {
System.out.println("Printer is ready");
}
}

interface Notifier {
default void greeting() {
System.out.println("Notifier is ready");
}
}
___

Create a free account to access the full topic