Friend and Encapsulation
It is said that friend classes violate encapsulation as it has an access to internals of the class in which it is declared. A friend allows a class a by hiding details that may be needed by anything but the friends of the class. It is also said that friend classes can also enhance encapsulation as it allows library writers to write an interface which is not compromised in order to allow proper internal referencing.
Read more about this topic: Friend Class
Famous quotes containing the words friend and and/or friend:
“A friend and I flew south with our children. During the week we spent together I took off my shoes, let down my hair, took apart my psyche, cleaned the pieces, and put them together again in much improved condition. I feel like a car thats just had a tune-up. Only another woman could have acted as the mechanic.”
—Anna Quindlen (20th century)
“She is such a good friend that she would throw all her acquaintances into the water for the pleasure of fishing them out again.”
—Charles Maurice Talleyrand (17541838)