Introduction to OOP Chapter 4: Classes and Methods: next previous audio real text

Why Use an Accessor?

There are many reasons why an accessor is preferable to providing direct access to a data field.

Some conventions encourage the use of a name that begins with get, (as in getRank()), but this is not universally followed.

Intro OOP, Chapter 4, Slide 20