What is the result of the following code snippet?
abstract class MyAbstract {
static void myMethod() {
System.out.println("Static Method");
}
}
class MyClass extends MyAbstract {
public static void main(String[] args) {
MyAbstract.myMethod();
}
}
static void myMethod() {
System.out.println("Static Method");
}
}
class MyClass extends MyAbstract {
public static void main(String[] args) {
MyAbstract.myMethod();
}
}
A. MyClass
B. Runtime exception
C. Static Method
D. Compilation error
Answer: Option C

Join The Discussion