I have a lot of these lying, and I wonder if I run into any problems or performance issues.
I have method A:
MyClass monkey; ... if(monkey != null) { ... }
Or method B:
boolean hasMonkey; //This is set to TRUE when monkey is not null MyClass monkey; ... if(hasMonkey) { ... }
At the functional level, they both do the same thing. Right now, I'm using method A. Is this a bad way to do something? What will be better?
java android
Richard Taylor
source share