• Post Reply Bookmark Topic Watch Topic
  • New Topic

catch block  RSS feed

 
Salman Riaz
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one explain to me why we declare class as final in out catch block
i.e
try {
// Some code
} catch( final FileNotFoundException fnfe ) {
// Some code
} catch( final IndexOutOfBoundException ioobe ){
// Some code
}
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class is not being declared as final in the posted examples. The references are being declared as final, so that they are not inappropriately reassigned to other objects.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!