Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于特定方法,如何使用反射查看 java 中的已检查异常?JDK 中似乎不支持此功能。
使用此方法Method:
Method
public Type[] getGenericExceptionTypes()
然后,如果要分隔已检查和未检查的异常,则必须遍历类型。