Loading lesson…
Level 1 · Apprentice0 XP
How Java models behaviour, and why 'program to an interface' is not a slogan.
Step 1 / 5
ProblemA report method takes an ArrayList and a MySqlUserStore. It cannot be given a LinkedList or a fake store in a test. Every caller is tied to exact classes it does not care about.
← → step
Before this: Values, references and strings
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write an interface Notifier with send(message), two implementations (email, SMS), and a class Alerts that takes a Notifier in its constructor. Test Alerts with a third implementation that only records messages in a list.