多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### 以下两种情况不会运行 #### 中止jvm ``` public class FinallTest { public static void main(String[] args) { try { System.out.println("one"); System.exit(0); } catch (Exception e) { System.out.println("second"); System.exit(0); } finally { System.out.println("third"); } } } ``` #### 守护线程中的finally ``` public class FinallTest { public static void main(String[] args) { Thread thread = new Thread(new DeamanRunner()); thread.setDaemon(true); thread.start(); } static class DeamanRunner implements Runnable { @Override public void run() { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); }finally { System.out.println("hahhhhh"); } } } } ```