ArrayList<? extends Prouduct> list = new ArrayList<Tv>();

--> 제너릭의 타입을 자손객체도 쓸 수 있게 해줌
static <T> void sort(List<T> list, Comparator<? super T> c)
class FruitBox<T> { // 제너릭 클래스
...
static <T> void sort(List<T> list, Comparator<? super T> c ) { // 제너릭 메서드
...
}
}
메서드를 호출할 때마다 타입을 대입해야(대부분 생략 가능)
메서드를 호출할 때 타입을 생략하지 않을 때는 클래스 이름 생략 불가
System.out.println(<Fruit>makeJuice(fruitBox)); // 에러. 클래스 이름 생략 불가
System.out.println(this.<Fruit>makeJuice(fruitBox)); // ok
System.out.println(Juicer.<Fruit>makeJuice(fruitBox)); // ok
제너릭 메서드는 메서드를 호출할 때마다 다른 제너릭 타입을 대입할 수 있게 한것
static <T extends Fruit> Juice makeJuice(FruitBox<T> box {
...
})
와일드 카드는 하나의 참조변수로 서로 다른 타입이 대입된 여러 제너릭 객체를 다루기 위한 것
static Juice makeJuice(FruitBox<? extends Fruit> box){
...
}