| ||Data Access, Properties, and Methods - slide 22 : 29|
Passing references as value parameters
Care must be taken if we pass references as value parameters
The class Date and the method DayDifference with a value parameter.
The class Person which calls DayDifference on dateOfBirth.
A client of Person and Date which reveal the consequences.
Client program output.
Passing references as ref parameters
In case a reference is passed as an argument to a value parameter, the referenced object
can be modified through the formal parameter