This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I wanted to be sure that in this case it is not necessary for items to be declared final, since its being used w/in the annonymous inner class. Also wanted to be sure that if this were the case that this annonymous inner class were inside a method, then and only then, would the methods local var and parameter need to be final. Thanks guys
Your example looks fine. You only need to worry about final local variables in the method that contains an inner class, anonymous or not. And remember that method arguments are local variables as well. But any local variables you create *inside* your inner class are fine and don't need final. Rob
Joined: Jan 17, 2002
Thanks G its all clear to me now, appreciate that. Issue closed
Joined: Jan 07, 2002
Oh, I dunno. It seems like issues never get closed around here Rob :roll: