Static variable loses value

后端 未结 2 2081
难免孤独
难免孤独 2021-01-18 08:53

I\'m facing an issue regarding a static variable that i\'m am using all over my project(it contains some fields from a file). The variable loses her value in some cases, not

2条回答
  •  梦毁少年i
    2021-01-18 09:25

    You my want to make sure, first, that you don't inadvertently reset that variable yourself. For this you may want to create, say, getMyVariable() and setMyVariable() functions, put some logging into them and use them instead of accessing the variable directly.

提交回复
热议问题