✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the output of the following code?
interface MyInterface {
default void display() {
System.out.println("MyInterface");
}
}
class MyClass implements MyInterface {
public void display() {
System.out.println("MyClass");
}
}
public class Main {
public static void main(String[] args) {
MyInterface obj = new MyClass();
obj.display();
}
}