Basic Inheritance
public class Animal
{
public void Greet()
{
Console.WriteLine("Hello, I'm some sort of animal!");
}
}
public class Dog : Animal
{
}
Animal animal = new Animal();
animal.Greet();
Dog dog = new Dog();
dog.Greet();
Basic Inheritance
public class Animal
{
public void Greet()
{
Console.WriteLine("Hello, I'm some sort of animal!");
}
}
public class Dog : Animal
{
}
Animal animal = new Animal();
animal.Greet();
Dog dog = new Dog();
dog.Greet();
Comments