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