Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package jp.co.confrage.decorator;
public class Milk extends Decorator {
public Milk(Coffee coffee) {
super(coffee);
}
@Override
public int price() {
return coffee.price() + 10; // ミルクは+10円とする
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment