Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public abstract class BauholzCollection {
- private Set<Collection<? extends Bauholz>> woodPiles = new HashSet<>();
- protected void addWoodPileForPrintList(Collection<? extends Bauholz> pile){
- woodPiles.add(pile);
- }
- public void list(){
- for (Collection<? extends Bauholz > pile: woodPiles){
- for (Bauholz piece: pile){
- System.out.println("Length: " + piece.getLength());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement