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 word friend:
“Men always sell strawberries, women, blackberries, your all- knowing Creole friend says. Why? you ask. Ah, it has always been that way. When you get to know Creoles better, you realize that the phrase It has always been that way justifies everything.”
—For the City of New Orleans, U.S. public relief program (1935-1943)