I remarked the compiler generates a warning if I suppress the override/new (Overloads/Shadows) keyword. Normally, I set the necessary keyword.
But what if i forget it?
// >>>> Case A - not virtual property -
class MyPoint : Point
{
int X { get; set; } // vs new int X { get; set; }
}
// >>>> Case B - virtual property -
class Foo
{
virtual int Value { get { return 0; } }
}
class Bar : Foo
{
// vs override/new int Value { get { return 1; } }
int Value { get { return 1; } }
}