Difference between try-finally and try-catch

前端 未结 11 548
栀梦
栀梦 2020-12-23 03:05

What\'s the difference between

try {
    fooBar();
} finally {
    barFoo();
}

and

try {
  fooBar();
} catch(Throwable thro         


        
11条回答
  •  自闭症患者
    2020-12-23 03:08

    In My reasearch Finally block is always executed and it is mainly "used for the any open connections to close" and to destroy something that is running unnecessarily.

提交回复
热议问题