¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
what is the flow of try, catch, and finally in java?
can you give some example? just an easy one.
2 Respuestas
+ 1
catch block is for exception handling,
if it is executed without re-throw, program continues after block or in finally block if present
finally block (optional) is for resources release (close)
finally block is executed even when in catch is re-throw exception
if finally block throw exception, catch block is ignored
if there are no re-throws, program continues after finally block
+ 1
Make sure to check the Java lesson about exception handling and you will find loads of information in the comments below the lesson
https://www.sololearn.com/learn/Java/2175/