How many statements in a try/catch statement?

前端 未结 13 1378
予麋鹿
予麋鹿 2021-01-12 12:42

Should I put multiple statements in a try and then catch all possible exceptions, or should I put only one statement in the try statement?

Example:



        
13条回答
  •  萌比男神i
    2021-01-12 13:13

    I would prefer using multiple statements in a try block and then catch all possible exceptions. Not sure why but I always do that while coding

提交回复
热议问题