Problem of the Day
Thursday, February 12, 2026
Problem:
Which of the following correctly categorize the indicated abstraction of a cup of coffee?
CoffeeCup | myCup | fillCup | sip | |
| a. | class | instance | accessor method | mutator method |
| b. | instance | class | mutator method | accessor method |
| c. | class | instance | accessor method | accessor method |
| d. | class | instance | mutator method | mutator method |
The correct answer is d. The capitalized CoffeeCup typically represents a class, while the instance name starts with a lowercase letter, myCup. Both the fillCup and sip methods change the amount of coffee in the cup, and are therefore mutator methods.