Back to Intellij Community

MethodOverridesStaticMethod

java/java-impl/resources/inspectionDescriptions/MethodOverridesStaticMethod.html

2025.3-rc-2381 B
Original Source

Reports static methods with a signature identical to a static method of a superclass. Such a method may look like an override when in fact it hides the method from the superclass because static methods in Java cannot be overridden.

Example:

class Parent {
    static void method(){}
  }

  class Example extends Parent {
    static void method(){} //warning
  }