Engineering Full Stack Apps with Java and JavaScript
What will the program print?
class Parent{ public static void myMethod() { System.out.println("Parent myMethod"); } } class Child extends Parent{ public static void myMethod() { System.out.println("Child myMethod"); } } class OverridingCheck { public static void main(String args[]) { Parent p = new Child(); p.myMethod(); } }
Select 1 option
A. Prints "Parent myMethod"
B. Prints "Child myMethod"
C. Compilation Fails
D. Exception at Runtime