Java 7 - Precise rethrow with a final Exception

前端 未结 3 778
礼貌的吻别
礼貌的吻别 2021-01-01 12:47

In previous versions of java, rethrowing an exception was treated as throwing the type of the catch parameter.

For example:

public static void test()         


        
3条回答
  •  生来不讨喜
    2021-01-01 13:04

    Without the final it is still valid java. You just lose the benefit of it being 'precise'.

提交回复
热议问题