<分区>
Possible Duplicate:
Why doesn’t Java allow generic subclasses of Throwable?
我正在尝试在这样的泛型类中创建一个常规的 RuntimeException:
public class SomeGenericClass<SomeType> {
public class SomeInternalException extends RuntimeException {
[...]
}
[...]
}
这段代码让我在 RuntimeException
这个词上出错说The generic class SomeGenericClass<SomeType>.SomeInternalException may not subclass java.lang.Throwable
.
这个 RuntimeException 与我的类是泛型有什么关系?