Friday, March 3, 2017

Inheritance

Inheritance is design to inherit the member of exiting class. In this example Tiger class inherit by Animal.


Example:


public class Tiger
{
    public string Animalti()
    {
        return "tiger is an animal";
    }
}
public class Animal : Tiger
{
    public string Animals()
    {
        Animalti();
        return "this is the Animalcls";
    }

}

No comments:

Post a Comment