Is it bad practice for a class to have only static fields and methods?

后端 未结 14 710
予麋鹿
予麋鹿 2020-11-30 03:05

I have a class that consists only of static member variables and static methods. Essentially, it is serving as a general-purpose utility class.

Is i

14条回答
  •  一整个雨季
    2020-11-30 03:25

    The Collections class in Java SDK has static members only.

    So, there you go, as long as you have proper justification -- its not a bad design

提交回复
热议问题