A

Admin • 830.13K Points
Coach

Q. What is the result of the following code snippet?

interface MyInterface {
static void myMethod() {
System.out.println("Static Method");
}
}
class MyClass implements MyInterface {
public static void main(String[] args) {
MyInterface.myMethod();
}
}

  • (A) Static Method
  • (B) Compilation error
  • (C) Runtime exception
  • (D) MyClass
  • Correct Answer - Option(A)
  • Views: 10
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.