Compiler Error J0140

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

The compiler detected an attempt to override a static method from within a subclass. A method that has been declared as static cannot be overridden.

The following example illustrates this error:

public class Simple {
   
   static void method1() {}
}

class SimpleSubclass extends Simple {
   
   void method1() {}
   // error: cannot override 
   // static method
}