Scenario 1:
Class a{public void Show ()}class b:a{public Void Show ()}
Compile through, there is a warning to add the new keyword in the method of B in order to hide the method of a
Compile-time binding (call method based on claim type)
Scenario 2:
Class a{public virtual void Show ()}class b:a{public Void Show ()}
Compile through, there is a warning to add the new or override keyword in the method of B, the method of A is hidden by default
Compile-time binding (call method based on claim type)
Scenario 3:
Class a{public virtual void Show ()}class b:a{public override void Show ()}
Compiled by
Run-time bindings (calling methods based on actual type)
Scenario 4:
Class a{public void Show ()}class b:a{public override void Show ()}
Compile error, the override method must be abstract, virtual, or override.
Conclusion 1: If you want to use dynamic binding (runtime binding)
Class a{public virtual void Show ()}class b:a{public override void Show ()}
Conclusion 2: If you want to use static bindings (compile-time binding)
Class a{public void Show ()}class b:a{public new Void Show ()}
It seems that can not be bookworm, or practical operation is easier to figure out:)
Several combinations of c#virtual and override