Uncatchable ChuckNorrisException

前端 未结 17 2151
时光取名叫无心
时光取名叫无心 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 04:01

    In the constructor you could start a thread which repeatedly calls originalThread.stop (ChuckNorisException.this)

    The thread could catch the exception repeatedly but would keep throwing it until it dies.

提交回复
热议问题