Skip to content

2.1 Summary

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