In Java, is there any disadvantage to static methods on a class?

后端 未结 14 1443
无人及你
无人及你 2020-12-03 06:37

Lets assume that a rule (or rule of thumb, anyway), has been imposed in my coding environment that any method on a class that doesn\'t use, modify, or otherwise need any ins

14条回答
  •  失恋的感觉
    2020-12-03 07:01

    One disadvantage is if your static methods are general and distributed in different classes as far as usage is concerned. You might consider putting all static methods that are general in a utility class.

提交回复
热议问题