package CHAPTER09;

public class GenericClass<T> { // 제네릭 클래스 정의
	private T item;

    public void setItem(T item) {
        this.item = item;
    }
    public T getItem() {
        return item;
    }
    
	public static void main(String[] args) {
		C9_01_GenericClass<String> stringBox = new C9_01_GenericClass<>();		
        stringBox.setItem("Hello");
        System.out.println(stringBox.getItem());   // 출력: Hello

        C9_01_GenericClass<Integer> intBox = new C9_01_GenericClass<>();        
        intBox.setItem(123);
        System.out.println(intBox.getItem());     // 출력: 123
	}
}
