theilgaz / call-child-overridden-method-from-parent-class

when foo is called from the child class, child's bar will be called, instead of parent's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

call-child-overridden-method-from-parent-class

when foo is called from the child class, child's bar will be called, instead of parent's

Flow

Entrypoint

MyForm.Ctor

Steps

  1. Call Child.CallFoo() method in MyForm.Ctor().
  2. This method will execute Base.Foo().
  3. Base.Foo() will execute Base.Bar().
  4. Base.Bar() will execute Child.Bar().
  5. MessageBox will raise for "Called Child.Bar"

About

when foo is called from the child class, child's bar will be called, instead of parent's


Languages

Language:C# 100.0%