Java - Inheritance
What will be the output of this Java code?
class Parent {
void greet() { System.out.println("Hello from Parent"); }
}
class Child extends Parent {
void greet() { System.out.println("Hello from Child"); }
}
public class Test {
public static void main(String[] args) {
Parent p = new Child();
p.greet();
}
}