I have very simple question. I am not using it but I have curiosity to know the answer. Can we execute multiple statements in catch block only if the exception get catched? I mean in my code below will both statement will get executed or not? Let me add some code snippet to make it clear..
I have found this link but not giving me the answer to my question. link Click Here
The above link I found in this question asked by someone but It has very blurry code so hard to understand. stackoverflow Link
try { int x = doXProcess(); int y = doYProcess(); } catch (Exception e) { System.out.println("Error related x: " x + e.printStackTrace()); System.out.println("Error related y: " y + e.printStackTrace()); } Thanks you for your help and time.