빌더패턴 직접 구현해보기
public class Item { private int id; private String name; private int price; private int count; private Item(int id, String name, int price, int count) { this.id = id; this.name = name; this.price = price; this.count = count; } @Override public String toString() { return "" + this.id + " " + this.name + " " + this.price + " " + this.count; } public static ItemBuilder builder() { return new ..
CS구멍/디자인패턴
2024. 11. 5. 20:31