Should Helper/Utility Classes be abstract?

前端 未结 11 1960
时光说笑
时光说笑 2020-12-13 08:38

I commonly find myself extracting common behavior out of classes into helper/utility classes that contain nothing but a set of static methods. I\'ve often wondered if I sho

11条回答
  •  粉色の甜心
    2020-12-13 09:00

    You could just declare a private constructor that does nothing.

    The problem with declaring the class "abstract" is that the abstract keyword usually means that class is intended to be subclassed and extended. That's definitely not what you want here.

提交回复
热议问题