In Java, is the “finally” block guaranteed to be called (in the main method)?

前端 未结 10 2041
执念已碎
执念已碎 2020-12-06 09:17

I\'m a Java rookie and I was wondering, if I have the following typical Java code

public class MyApp {
  public static void main(String[] args) {
    try {
          


        
10条回答
  •  悲&欢浪女
    2020-12-06 10:00

    the only exceptions finally block is not executed are, either JVM crashes, or system.exit().

提交回复
热议问题