Java - Polymorphism
What will be the output of this code?
class Parent {
protected Number getValue() { return 10; }
}
class Child extends Parent {
@Override
public Integer getValue() { return 20; }
}
public class Test {
public static void main(String[] args) {
Parent p = new Child();
System.out.println(p.getValue());
}
}