| method-parameters/by-value/class/person.cs - The class Person which calls DayDifference on dateOfBirth. | Lecture 5 - slide 22 : 29 Program 2 |
public class Person{
private string name;
private Date dateOfBirth, dateOfDeath;
public Person (string name, Date dateOfBirth){
this.name = name;
this.dateOfBirth = dateOfBirth;
this.dateOfDeath = null;
}
public string Name{
get {return name;}
}
public Date DateOfBirth{
get {return dateOfBirth;}
}
public int DayAge(){
return new Date(2008, 3, 11).DayDifference(dateOfBirth);
}
public override string ToString(){
return "Person: " + name + " " + dateOfBirth;
}
}