A client of Person and Date which reveal the consequences. | Lecture 5 - slide 22 : 29 Program 3 |
using System; class Client{ public static void Main(){ Person p = new Person("Hanne", new Date(1926, 12, 24)); Console.WriteLine("{0}", p); int age = p.DayAge(); Console.WriteLine("{0} of age {1}", p, age); } } | DayAge calls DayDifference which mutates Hanne's birthday. |