The compiler can perfectly well figure out which types of exception t could hold and prove that Listing 1 will not violate the contract of foo - without making the programmer jump through hoops.
编译器可以非常清楚地找出哪种类型的异常t可以保留并证实清单1不会违反foo的合同—而无需程序员赴汤蹈火。
But the exception parameter t is declared as a Throwable, and Throwable cannot be thrown from foo unless the throws clause is modified.
但是异常参数t被声明为Throwable,且如果没有修改throws子句,则Throwable不能从foo中抛出。
But the exception parameter t is declared as a Throwable, and Throwable cannot be thrown from foo unless the throws clause is modified.
但是异常参数t被声明为Throwable,且如果没有修改throws子句,则Throwable不能从foo中抛出。
应用推荐