같은 클래스에 선언되어 있으면 해당 값은 대체 값과 같으며 컴파일 오류가 발생합니다.
Two method signatures m1 and m2 are override-equivalent iff either m1 is a subsignature of m2 or m2 is a subsignature of m1.
및
The signature of a method m1 is a subsignature of the signature of a method m2 if either:
- m2 has the same signature as m1, or
- the signature of m1 is the same as the erasure (§4.6) of the signature of m2.
굵게 표시된 경우는 여기에 문제가있는 Java Language Specification
It is a compile-time error to declare two methods with override-equivalent signatures in a class.
에서
.
Class<?>
의 삭제는 Class
입니다.
Is there any difference between void f(Class c) and void f(Class c) in Java?
호출자의 관점에서 볼 때, 아니요. 방법 본문 내에서 네. 첫 번째 경우 매개 변수는 raw typeClass
입니다. 두 번째 경우 매개 변수의 매개 변수화 된 형식은 Class<?>
입니다.
의미 론적으로, 하나의 일반적이고 명시 적으로 야생, 다른 비 제네릭 – raptortech97