public struct Date{
private int year, month, day;
public Date(int year, int month, int day){
this.year = year; this.month = month; this.day = day;
}
public int Year{
get{return year;}
set{year = value;}
}
public int Month{
get{return month;}
set{month = value;}
}
public int Day{
get{return day;}
set{day = value;}
}
public int DayDifference(Date other){
other.year++;
return ...;
}
public override string ToString(){
return string.Format("{0}.{1}.{2}",day, month, year);
}
} | | A struct - not a class.
A COPY of the actual parameter is mutated.
Return the appropriate integer result.
|