Hi
I have a method, which is called more than 50 times a second.
I have multiple(more than 10) individual variables of different data types initialised in that method & in last part of the method, a single String is returned appending the value of all variables (with conditions on value).
So it is good idea to have these individual variables as local to that method, for which each call statement to that method will cause allocation of memory for them; or should I declare it as member variable of class.
The vaiables are not useful outside method.
eg
String methodName() {
int v1 = 98;
float v2 = 1.0;
long v3 = 2947239L;
.
.
char v10 ='R';
String str = v1 + v2 + v3;
return str;
}
Thanks in advance.