public class Throws extends Object
| 构造器和说明 |
|---|
Throws() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T extends Exception,R> |
sneakyThrow(Exception t)
Java 8 Type-Inference, Which simply means that every T in “T extends Throwable” is generously
inferred to be a RuntimeException if an inference of a more concrete type is not possible.
|
public static <T extends Exception,R> R sneakyThrow(Exception t) throws T extends Exception
T - Subclass of ExceptionR - Return typet - ExceptionT - RuntimeExceptionT extends ExceptionCopyright © 2018. All rights reserved.