Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package jp.co.confrage.decorator;
public class DecoratorSample {
public static void main(String[] args) {
Coffee coffee = new Coffee();
coffee = new Milk(coffee); // ラップ
System.out.println(coffee.price()); // 360
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment