Is there any way to set the life cycle of a static variable – ie: how long it’s kept alive before being reset? I was hoping there may be an attribute which can be applied.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Static members are associated with the type itself, not with an instance of the type. Therefore their lifecycle is limited to the timing and ordering of their creation, and they don’t get “reset” by instances of the type.