A
Q. What is the result of the following code snippet?
interface MyInterface {
default void myMethod() {
System.out.println("Default Implementation");
}
}
class MyClass implements MyInterface {
public static void main(String[] args) {
MyInterface obj = new MyClass();
obj.myMethod();
}
}
- Correct Answer - Option(A)
- Views: 33
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.