Java: Encore Le Mot clé finally

Author:


{filelink=4355}

public class ExceutionFinaly {

  public static void main(String[] args) {
    System.out.println("Le premier bloque de try");
    try {
      System.out.println("Try imbriqué");
      try {
        throw new Exception();
      } finally {
        System.out.println("finally dans le try imbriqué");
      }
    } catch (Exception e) {
      System.err.println("Attraper la première exception");
    } finally {
      System.err.println("finally de la première Exception");
    }
  }
}

A Voir sur le même Sujet:

  • mot clé finally java

Leave a Reply

Your email address will not be published. Required fields are marked *