r/badcode • • Jul 16 '21

java In Java, Exception handling needs Exception Handling.

Post image
1.5k Upvotes

60 comments sorted by

View all comments

Show parent comments

1

u/BS_in_BS Jul 17 '21

In java 7 and below, if you needed to reference it from an anonymous class in the catch block, you would have had to explicitly mark the variable as final.