Java 제네릭에는 언제 <가 필요합니까? <T> 대신 T>를 확장하고 스위칭의 단점이 있습니까?
다음 예에서 Hamcrest 매처와 함께 JUnit 사용 : Map<String, Class<? extends Serializable>> expected = null; Map<String, Class<java.util.Date>> result = null; assertThat(result, is(expected)); 다음과 같은 JUnit assertThat메소드 서명으로 컴파일되지 않습니다 . public static <T> void assertThat(T actual, Matcher<T> matcher) 컴파일러 오류 메시지는 다음과 같습니다. Error:Error:line (102)cannot find symbol method assertThat(java.util.Map<java.lang.String,java.lang.Class<java.util.Date>>, org.hamcrest.Matcher<java.util.Map<java.lang.String,java.lang.Class …