June 2018
Beginner
722 pages
18h 47m
English
As the title of this section has stated, that is all we can say about the accessibility of a constructor. Naturally, when we talk about constructors, we talk only about classes.
The interesting thing about constructors is their ability to have private access only. It means that a class can provide its own factory method (see Chapter 6, Interfaces, Classes, and Object Construction), control how each object is constructed, and even control how many of them can be put into the circulation. The last feature is especially valuable in the case where each object requires access to a certain resource (a file or another database) that has limited support for concurrent access. Here is ...
Read now
Unlock full access