Using properties as described earlier in this chapter would seem to violate the notion of
private data. Although providing a property with
set accessors may appear to be the same as making its corresponding instance variable
public, this is not the case. A
public instance variable can be read or written by any property or method in the program. If an instance variable is
private, the client code can access the instance variable only indirectly through the class’s non-
private properties or methods. This allows the class to control the manner in which the data is set or returned. For example,
set accessors can translate between the format of the data stored in the ...