7.11. Modifiers in Declarations
We've used a variety of class, method, and instance variable modifiers in this chapter: public, private, protected, and static. These were relatively obvious from context or from the brief explanation provided when they were used, but it is worth reviewing all the possible modifiers and explicitly stating their purpose.
These modifiers designate the other classes that are allowed to see the data inside an object you write. Table 7.1 summarizes them, with more details given below. If you are not familiar with object-oriented programming already, just look at public and private and forget the other options for now. For people with a C++ background, consider classes within the same package to ...