💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### 以下两种情况不会运行 #### 中止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"); } } } } ```