Actions speak louder than words.
Sometimes you need to group your objects together based on the things they can do rather than the classes they inherit from. That’s where interfaces come in—they let you work with any class that can do the job. But with great power comes great responsibility, and any class that implements an interface must promise to fulfill all of its obligations...or the compiler will break their kneecaps, see?
The General Bee-namics corporation wants to make the Beehive Management System you created in the last chapter into a full-blown Hive Simulator. Here’s an overview of the specification for the new version of the program:
The bees in the new Hive Simulator will still consume honey in the same way they did before. The queen still needs to be able to assign work to the workers and see the shift reports that tell who’s doing what. The workers work shifts just like they did before, too, it’s just that the jobs they are doing have been elaborated a little bit.