Mając takie klasy:
class Animal
{
EnumColor color { get; set; }
}
class Dog : Animal
{
EnumColor color = EnumColor.dark;
}
class Cat : Animal
{
EnumColor color = EnumColor.grey;
}
class EnumColor
{
dark,
grey,
brown
}
Chciałbym zrobić funkcję, gdzie wypisuję kolor zwierzęcia:
private void printColor(Animal animal)
{
Console.WriteLine(animal.EnumColor.ToString());
}
Dostaję jednak komunikat:
Use the new keyword if hiding was intended
Gdzie jest bląd?