Compiler Error J0142

Cannot make static call to abstract method 'identifier'

The compiler detected an attempt to directly call an abstract method. Abstract methods are defined to provide a definition of a method to be implemented by subclasses; therefore, abstract methods do not have implementation code. Because of this lack of implementation in an abstract method, calling an abstract method using the super keyword is invalid.

The following example illustrates this error:

public abstract class Simple {
   
   abstract int method1();
}

class SimpleSubclass extends Simple {
   
   int method1() {
      
      return super.method1();
      // error: cannot call abstract method
   }
}