Skip to content

Instantly share code, notes, and snippets.

@pawelpluta

pawelpluta/WashingMachine.java Secret

Last active Oct 8, 2020
Embed
What would you like to do?
Article: The OOP has been explained wrongly to you - solution
class WashingMachine {
private Programme programme;
private Laundry laundry;
void selectProgramme(Programme programme) {
this.programme = programme;
}
Laundry takeOutLaundry() {
return laundry;
}
void addLaundry(Laundry laundry) {
this.laundry = laundry;
}
void start() {
laundry.asList().forEach(laundryElement -> laundryElement.clean());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment