I am wondering if there is a way to override a variable with the same name with a different type in the derived class. Something along the lines of this (although this code will not compile):
public class A
{
public virtual Point2D Point; // Represent a 2D point
}
public class B : A
{
public override Point3D Point; // Represent a 3D point
}
The reason for doing this is that A
and B
may share similar properties, just that the dimension of the Point
is different.