Is there ever a reason to not use the final keyword when catching an exception?

后端 未结 5 941
萌比男神i
萌比男神i 2020-12-16 12:03

I\'ve seen some code as below in some example BlackBerry Java classes:

try
{
    // stuff that will throw an exception
}
catch(final Exception e)
{
    // de         


        
5条回答
  •  情话喂你
    2020-12-16 12:19

    I'm not sure it's about performance, but more about convention. If you're using Eclipse, try to set a formatter that add the final keyword wherever it's possible, and reformat your source code with that formatter.

提交回复
热议问题