5
자바 : 제한된 와일드 카드 또는 제한된 유형 매개 변수?
최근에 다음 기사를 읽었습니다. http://download.oracle.com/javase/tutorial/extra/generics/wildcards.html 내 질문은 다음과 같은 방법을 만드는 대신입니다. public void drawAll(List<? extends Shape> shapes){ for (Shape s: shapes) { s.draw(this); } } 다음과 같은 메서드를 만들 수 있으며 제대로 작동합니다. public <T extends Shape> void drawAll(List<T> shapes){ for (Shape s: shapes) { s.draw(this); } } 어떤 …