public void method() { System.out.println("1"); try { System.out.println("2"); throw new Exception("Hello"); System.out.println("3"); } catch (Exception e) { System.out.println("4"); throw e; System.out.println("5"); } finally { System.out.println("6");`од` } System.out.println("7"); } 

Why is this code not compiled?

  • one
    Why is it not compiled? What mistake? - Peter Samokhin
  • five
    What are you writing code in? Any little IDE after all will highlight directly in the code what is wrong. 1. The method is not declared that it throws an exception. 2. In the try and catch blocks, and also after the finally block, there is an unreachable code. 3. In the finally block, there are generally any misunderstood "od" characters. - Regent
  • Yes 1 I understand. But why there is an inaccessible code no - Marjan Servachak

0