i have one class named with Animal, with Name, Type, Gender, and i have another class named with AnimalList, i need to know how can i add Animals to my AnimalList, this is my class animal(im in console application):
Filename Animal.cs
class Animal
{
public string Name {get; set;}
public string Type {get; set;}
public string Gender {get; set;}
public Person(string name, string type, string gender)
{
Name = name;
Type = type;
Gender = gender;
}
}
And my class AnimalList:
FilenameAnimalList.cs
class AnimalList: List<Animal>
{
what should i do to add Animals to this list
}
shouldn't be better like this?
public new void Add(Animal value)
{
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…