Why is it preferable to call a static method statically from within an instance of the method's class?

前端 未结 5 1508
自闭症患者
自闭症患者 2021-01-13 10:16

If I create an instance of a class in Java, why is it preferable to call a static method of that same class statically, rather than using this.method()?

I get a warn

5条回答
  •  自闭症患者
    2021-01-13 10:50

    Because this. normally reference to instance methods, therefore, it's a bad idea to do that.

提交回复
热议问题