-
-
Save pawelpluta/b10d18d36de84e10648854896bbf427f to your computer and use it in GitHub Desktop.
Article: The OOP has been explained wrongly to you - solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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