Hello Dave, the reason you are able to override the SSN is because you did not subclass PatientSecureEntity2 class and try to override the SSN property in that new subclass. Once you do that then you will see that the final modifier does work as intended. Page 252 of the book says, "At times, you may want to prevent someone from overriding a member of a class or an entire class. Do this by using the final modifier. For example, if you don’t want anyone overriding the SSN property of the PatientSecureEntity class, you can mark it with the final modifier…” The key word her is “overriding.” If you try to override the final property in a new subclass you will get a compile-time error. Apple’s documentation on Preventing Overrides says, "You can prevent a method, property, or subscript from being overridden by marking it as final. Do this by writing the final modifier before the method, property, or subscript’s introducer keyword (such as final var, final func, final class func, and final subscript). Any attempt to override a final method, property, or subscript in a subclass is reported as a compile-time error.” So, try to subclass your PatientSecureEntity2 class and then try to override the SSN property. You should see the compile-time error. Hope that helps.
Angelina
Oak Leaf Enterprises, Inc.