 <p>This is <code>encapsulation</code>.</p> <p>If you have getters like these, then <code>private</code> access modifiers on your fields would make them more meaningful.</p> <pre><code>private double purchase; private int numItems; </code></pre>