finally in exception handling

后端 未结 8 1718
甜味超标
甜味超标 2021-01-18 17:08

What exactly does a finally block in exception handling perform?

8条回答
  •  醉酒成梦
    2021-01-18 17:42

    finally block is mainly used to perform close statement for example con.close that is to close connection from database....try block is always followed by either catch block or finally (or both also)...If you once entered in the try block then your finally block will be definately execute except system error,exception in finally block....Main key point of finally block is that it always be executed even the exception is handled or not..

提交回复
热议问题