Java:静态类? [英] Java: Static Class?
本文介绍了Java:静态类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个充满效用函数的类。实例化它的实例没有语义的意义,但我仍然想要调用它的方法。什么是最好的办法来处理这个?静态类?抽象?
I have a class full of utility functions. Instantiating an instance of it makes no semantic sense, but I still want to call its methods. What is the best way to deal with this? Static class? Abstract?
推荐答案
标记为final的类的私有构造函数和静态方法。
Private constructor and static methods on a class marked as final.
这篇关于Java:静态类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文