开发者

Am I correct supposing that if an exception occurs inside a try block, following lines inside the try are never executed?

In the followi开发者_JS百科ng example

try {
  lineA
  lineB
  lineC
  lineD
}
catch {
  lineE
}
finally {
  lineF
}

if an exception occurs (let's assume a 100% probability of an exception there) in lineB, then the total execution algorithm looks like

lineA  
lineB  
lineE  
lineF  

lines C and D are never reached. Am I 100% right?


Yes, you're correct presuming exception thrown is of type caught in catch block

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜