Compiler Error J0167

Cannot override non-static method 'identifier' with static method 'identifier'

The compiler detected an attempt to override a superclass method with a subclass method declared with the modifier static. When a method is overridden in a subclass, the method cannot raise or lower the access level of the method or apply the static modifier. Remove the static modifier from the overridden method declaration and compile again.

The following example illustrates this error:

public class Simple {
   
   public void method1() {
      // do something meaningful
   }
}

class Simple2 extends Simple {
   
   static public void method1() {
      // error: overriding superclass 'method1'
      // with a static method is not valid
   }
}