posted 14 years ago
ahhh, OK, that makes sense, I clearly missed the point of your original post.
Still, something doesn't feel right. the variable sumWhole is not declared within the method, so I guess it is an instance variable of the class this method is in.
Now, you are calling this method either from within this class, or from another class. Which is it?
So your method resets an instance variable each time it is called, then applies some math to it, then returns the instance variable, I guess there is a good reason for that, but it makes me think about taking a second look at how your variables are defined, maybe sumWhole should be a local variable?
Then again maybe it is ok, I guess it depends on the program.
cheers.