Of course, Square could also be declared friend of Rectangle, if needed, granting such an access.Another property of friendships is that they are not transitive: The friend of a friend is not considered a friend unless explicitly specified.