Polymorphism
From Logic Wiki
Revision as of 13:19, 15 September 2014 by Macrop (Talk) (Created page with "Category:OOP Category:Extreme Programming Category:CSharp if you want to use a method or property of a base class differently in child classes you need polymorphi...")
if you want to use a method or property of a base class differently in child classes you need polymorphism.
Simply add virtual keyword to base class's method
public virtual void Gazla(int ivme)
{
this.Hiz += ivme;
}
in child class
public override void Gazla(int icme)
{
// base.Gazla // to use base method as it is
this.hiz += 2 * ivme;
}