以下代码简化为问题的基本要点:
public class GenericTest { private interface copyInterface<T extends copyInterface<T>> { public void copyFrom(T source); } public void testMethod() { copyInterface<?> target; copyInterface<?> source; target.copyFrom(source); } }
这会导致以下编译器错误消息:
GenericTest.copyInterface类型中的copyFrom(capture#1-of?)方法不适用于参数(GenericTest.copyInterface)GenericTest.java / ACAF / src / de / tmasoft / acaftest / attributes第14行Java问题
当我使用原始类型作为变量目标时,我只得到一个原始类型的警告.有没有办法在不使用原始类型的情况下编译?