package CHAPTER09;

import java.util.ArrayList;
import java.util.List;

public class LowerBound {
	
	// 하한 제한 와일드카드: Integer와 그 상위 타입만 허용
    public static void addNumbers(List<? super Integer> list) {
        list.add(1);
        list.add(2);
    }

    public static void main(String[] args) {
        List<Integer> intList = new ArrayList<>();
        List<Number> numberList = new ArrayList<>();

        addNumbers(intList);
        addNumbers(numberList);

        System.out.println("Integer List: " + intList);    
        System.out.println("Number List: " + numberList); 
    }
}
