Chapter 7. Access Specifiers

An important aspect of object-oriented programming is data encapsulation (also called data hiding), whereby the implementation details of a class are kept hidden from the users of the class. Not only the implementation but also the data can be kept hidden from the user. Or one can choose to provide varying degrees of restricted access to those data members through functions.

In general, this concept can be simply stated as "differentiating things that change from things that do not." This is particularly important when you are writing an API library that the application developer is going to use. Any user of your API library should be able to rely on your API when writing the application and should not be forced to ...

Get Beginning JavaFX™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.