简体   繁体   English

类型变量用作异常参数

[英]The type variable used as exception parameter

Could you get an example for the following rule 您能否获得以下规则的示例

JLS 14.20 捷豹14.20

It is a compile-time error if a type variable is used in the denotation of the type of an exception parameter. 如果在异常参数的类型表示中使用类型变量,则是编译时错误。

It means something like this: 它的意思是这样的:

catch (MySpecialException<T> ex) {
    ...
}

T is a type variable here. T在这里是类型变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM