public static void Main()
Console.WriteLine((new Dog()).ToString());
public Animal(Animal other)
this.nickname = other.nickname;
this.gender = other.gender;
this.category = other.category;
this.species = other.species;
set { nickname = value; }
set { category = value; }
public override string ToString()
return String.Format(" {0, -44} {1, -22} {2, 10} {3, 10} {4, 10} {5, 10}", this.id, this.nickname, this.age, this.gender, this.category, this.species);
public class Dog : Mammal {
this.Nickname = other.Nickname;
this.Gender = other.Gender;
public override string ToString()
return String.Format(" {0} {1}", base.ToString(), "+ Doggie");
public class Mammal : Animal {
public Mammal(Mammal other)
this.Nickname = other.Nickname;
this.Gender = other.Gender;
this.Species = other.Species;
this.Category = "Mammal";
this.teeth = other.Teeth;
public override string ToString()
return String.Format(" {0} {1}", base.ToString(), "Has " + this.teeth + " teeth");