posted 8 years ago
Here's an example. I sometimes write a so-called "copy constructor" to create a new object based on an existing object of the same type. To instantiate its own fields, it needs access to the fields of the other object. Normally, you would access these fields through getters, but since the objects are of the same type, you can access the fields directly: