Stacie
asked on
simple class explanation
I was wondering what the public Patien( Visist = New List<Visit>) in this code mean. Is it a method that refer to a new class List?
Class Patient {
public Patient() {
Visits = new List<Visits>();
}
public int ID { get; set; }
public string Name { get; set; }
public DateTime BirthDate { get; set; }
public AnimalType AnimalType { get; set; }
public DateTime FirstVisit { get; set; }
}
Class Visist{
Public int Id {get; set;}
Public int PatientId { get; set;}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@it_saige
but unlike arrays, Lists are a type-safe objectArrays are type safe as well--provided you don't create an array of objects. Are you sure you weren't referring to ArrayList?
Open in new window
Now produces the following output --saige-