Learn AP Comp Sci

Problem of the Day

Thursday, February 12, 2026


Problem:

Which of the following correctly categorize the indicated abstraction of a cup of coffee?

CoffeeCupmyCupfillCupsip
a.classinstanceaccessor methodmutator method
b.instanceclassmutator methodaccessor method
c.classinstanceaccessor methodaccessor method
d.classinstancemutator methodmutator method

Show solution:

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.