Considering the knowledge I learned, this value should definitely be printed on a value of 20 instead of 10. But why does 10 come out? Am I misunderstanding the concept of override?
class Parent
{
public int Question()
{
return 10;
}
}
class Child : Parent
{
public new int Question()
{
return 20;
}
}
class Program
{
static void Main(string[] args)
{
Parent parent = new Child();
Console.WriteLine(parent.Question());
}
}