to put it very simply,
if i call getWidth(); and wish to use it 3, 4 or 50 times within a block or a class, is it better to call it once and assign it to variable, and then use the variable or call it every-time I need it?
Similarly , if I have a method to calculate some complex expression, is it better to call it every-time I need it or call it once and assign it to a variable?
Are there a cases for both?
thanks in advance..