Class-Level versus Object-Level Visibility

When we discuss visibility, here is an interesting question that language designers seem not to agree on. What exactly is the meaning of private? Private should clearly rule out access by the world at large, and by subclasses, but what about by sisters and brothers? If two objects are instances of the same class, should they be allowed to view each others private data areas?

As I said, some languages say yes, and some say no. If a language says yes we say it has class level visibility rules, as in C++ and Java. If it says no then it has object-level visibility rules.

[audio] [real] Text to accompany slide11, in Chapter 17 of An Introduction to Object-Oriented Programming