Why are static variables considered evil?

前端 未结 30 2727
既然无缘
既然无缘 2020-11-21 05:04

I am a Java programmer who is new to the corporate world. Recently I\'ve developed an application using Groovy and Java. All through the code I wrote used quite a good numbe

30条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-21 05:47

    Suppose that if you have an application with many users and you have defined a static function that saves state within a static variable, then every user will modify the state of other users.

提交回复
热议问题