Java Builder Pattern
C++이나 Python에서는 기본 파라미터 설정이 가능하다.
xclass Person: def __init__(self, age = 21): pass
자바는 기본 파라미터를 지원하지 않는다
대신 Builder Pattern을 이용해 구현할 수 있다
xxxxxxxxxxpublic class Person{ private int age = 21; public void SetAge(int _age){ this.age = _age; }}
참고 : stackoverflow
댓글