Skip to content

Instantly share code, notes, and snippets.

@reevik
Created February 14, 2022 16:15
Show Gist options
  • Save reevik/25bcdfd2d4d1c2eeb7b810d170ad114f to your computer and use it in GitHub Desktop.
Save reevik/25bcdfd2d4d1c2eeb7b810d170ad114f to your computer and use it in GitHub Desktop.
public class CatBar {
private List<Cat> catFriends = new ArrayList<>();
public void enter(Cat cat) {
catFriends.add(cat);
}
public void singTogether() {
for (Cat cat: catFriends) {
cat.sing();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment