Explain the importance of finally over return statement in Java?

Importance of finally over return statement in Java-

finally block is more important than return statement when both are present in a program.

For example,

if there is any return statement present inside try or catch block , and finally block is also present first
finally statement will be executed and then return statement will be considered.


Posted

in

Tags:

Comments

Leave a Reply