2.1 Summary
- Encapsulation is hiding the class's own attributes and/or methods that the class does not want to be accessed directly.
- The visibility modifier
privateensures that these attributes and methods are no longer directly accessible. - Instead, getters and setters can be defined for attributes.
- Constructor chaining is calling a more specific constructor from a more generic constructor.
- Objects can also be placed in an array and accessed via the index.