If System.exit (0); is written at the end of the try block, will the finally block still execute?

Java Programming Language >   Fundamentals of Object-Oriented Programming >   About Java Tutorial  

Short Question

1936


Answer:

No in this case the finally block will not execute because when you say System.exit (0); the control immediately goes out of the program, and thus finally never executes.


This Particular section is dedicated to Question & Answer only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.