In fact, I believe that you misunderstood the point of polymorphism in object-oriented programming.
Constants, fields, and variables are just a repository (well, references, but I speak from a conceptual point of view).
Polymorphism is a change in the behavior of something. Overriding a constant could not change the behavior, but it changed its meaning.
, , , AppDomain .
, ? ?
public class A
{
public virtual const int Some = 1;
}
public class B : A
{
public override const int Some = 2;
}
public class C : A
{
}
int valueOfSomeConstant = C.Some;
! , C.Some 2, C !
:
, const int - . [...]
: - .
, .