How do you crash a JVM?

前端 未结 27 1370
故里飘歌
故里飘歌 2020-11-28 00:22

I was reading a book on programming skills wherein the author asks the interviewee, \"How do you crash a JVM?\" I thought that you could do so by writing an infinite for-loo

27条回答
  •  Happy的楠姐
    2020-11-28 01:07

    If you want to crash JVM - use the following in Sun JDK 1.6_23 or below:

    Double.parseDouble("2.2250738585072012e-308");
    

    This is due to a bug in Sun JDK - also found in OpenJDK. This is fixed from Oracle JDK 1.6_24 onwards.

提交回复
热议问题