posted 15 years ago
Local variables are not assigned default values, instance variables are.
Therefore having an int defined at that scope would not get the default value of 0 either. It would however if you'd put it outside of your method as an instance variable.
I'd recommend reading the compiler error, as it will say something like variable i may not have been initialised.