D
DBC User
I have a method, in which I populate a local variable from a singleton
method value like the following
int age = SingletonAge.GetInstance().CurrentAge;
then I use age in two places in the method. Out of cuiosity, which is
a correct way to do this? If it is a singleton variable, then is it
better to use the property directly instead of assigning the value to
local stack variable?
Thanks.
method value like the following
int age = SingletonAge.GetInstance().CurrentAge;
then I use age in two places in the method. Out of cuiosity, which is
a correct way to do this? If it is a singleton variable, then is it
better to use the property directly instead of assigning the value to
local stack variable?
Thanks.