Uncatchable ChuckNorrisException

前端 未结 17 2142
时光取名叫无心
时光取名叫无心 2020-12-02 03:34

Is it possible to construct a snippet of code in Java that would make a hypothetical java.lang.ChuckNorrisException uncatchable?

Thoughts that came to m

17条回答
  •  [愿得一人]
    2020-12-02 03:53

    Call System.exit(1) in the finalize, and just throw a copy of the exception from all the other methods, so that the program will exit.

提交回复
热议问题