Обращение к полю другого класса - C#
Формулировка задачи:
Есть такой код, но у меня не получается его запустить. В классе Zoo не могу обратиться к полю класса Animal
class Animal
{
public string kindOfAnimal;
public string name;
public int numberOfLegs;
public int height;
public int length;
public string color;
bool hasTail;
protected bool isMammal;
private bool spellingCorrect;
}
class Zoo
{
Animal a = new Animal ();
a.kindOfAnimal = “Kangaroo”;
}Решение задачи: «Обращение к полю другого класса»
textual
Листинг программы
void f()
{
a.kindOfAnimal = "awds";
}