我的理解下面的代码应该运行没有任何编译错误。编译失败,通用类与通用接口
但是,当我运行这个程序时,我收到以下编译错误。
The member type B.D cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type B
class B<X> {
interface C {
}
interface D<Y> {
}
}
class Test {
// compilation fails here
B<String>.D<String>[] arr = new B<String>.D<String>[10];
}
请帮助我理解这种行为。
为了记录:我从您的示例中删除了第一个A类 - 因为该类不会导致整体问题。所以我觉得它很混乱。 – GhostCat
@ GhostCat-谢谢。 –