Methods get overridden fields get shadowed, therefore methods depend on the object while fields depend on the reference type, since you declared the reference as Base, you get the value of the base field.
Completely agree with Mark .
Method overriding is done at compile and run time .Compiler will resolve which method to call and further resolved at runtime to the correct version of that method to call.Here at compile time compiler will call the show() and further at runtime it decides the Child version's of show() , because the actual object of type Child .But in the case of property the reference comes into the picture and the behavior is as expected !!!
S Majumder wrote: . . .
Method overriding is done at compile and run time . . .
No, overriding is resolved at runtime. At compile time there is a check for which methods override each other, but the actual binding is not done until runtime.