Are global static classes and methods bad?

前端 未结 10 1275
予麋鹿
予麋鹿 2020-12-02 13:36

It\'s generally agreed upon that relying heavily on global stuff is to be avoided. Wouldn\'t using static classes and methods be the same thing?

10条回答
  •  一整个雨季
    2020-12-02 14:08

    As an addition to whatever else is said, final static variables are just fine; constants are a good thing. The only exception to that is when/if you should just move them to a properties file, to be easier to change.

提交回复
热议问题