Read up about scoping rules. Make the variable available to all of the method.
Although this is quite bad practice as the loop counter declaration should
reside within the for loop header.
...