
제네릭 (1)
·
Java
제네릭이 필요한 이유public class IntegerBox { private Integer value; public void set(Integer value) { this.value = value; } public Integer get() { return value; }}public class StringBox { private String value; public String get() { return value; } public void set(String value) { this.value = value; }} 숫자, 문자열을 보관하고 꺼낼 수 있는 단순한 클래스이다.package mid2.g..