using Newtonsoft.Json.Schema;
using System.Collections;
using System.Collections.Generic;
public static void Main()
List<Dog> dogs = new List<Dog>();
dogs.Add(new Dog("Fido"));
dogs.Add(new Retriever("Dave", "Golden"));
dogs.Add(new Pitbull("John"));
static void PrintPopulation()
Console.WriteLine("Total Population is " + Person.Population);
public override string ToString()
return "The dog's name is " + Name;
public class Retriever : Dog
public string RetrieverType;
public Retriever(string name, string retrieverType)
RetrieverType = retrieverType;
public override string ToString()
return "The retriever's name is " + Name + " and type is " + RetrieverType;
public class Pitbull : Dog
public Pitbull(string name)
public static int Population;
public Person(string firstName, string lastName)
public void GiveBirthday()
public override string ToString()
return FirstName + LastName + ", age " + Age + ". Alive: " + Alive;