
Let's take an example:-
//Here your Base class,which contains Display method,you can Override this method in Derived class as shown below:-
public class Base_Class
{
public Base_Class()
{
}
public virtual void display()
{
Console.WriteLine("base class");
}
}
//Here your Derived class
public class Derive_Class:Base_Class
{
public Derive_Class()
{
}
public override void display()
{
Console.WriteLine("derive class");
}
}
We can override existing method,and write our own Logic in Dereved class.
As you can see in the derived class,i have override method display.
So you can also override your own method and write own logic.
krrishbiju-15589, if this helps please login to Mark As Answer. | Alert Moderator