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

后端 未结 14 703
予麋鹿
予麋鹿 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

    It's perfectly reasonable. In fact, in C# you can define a class with the static keyword specifically for this purpose.

提交回复
热议问题