πŸ“Š JAVA
Q. What is the result of the following code snippet?

interface MyInterface {
void myMethod();
}
public class MyClass implements MyInterface {
public void myMethod() {
System.out.println("Implementation");
}
public static void main(String[] args) {
MyInterface obj = new MyClass();
obj.myMethod();
}
}
  • (A) Compilation error
  • (B) Runtime exception
  • (C) MyClass
  • (D) Implementation
πŸ’¬ Discuss
βœ… Correct Answer: (D) Implementation

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
75
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Pooja
Publisher
πŸ“ˆ
91%
Success Rate