Compiler Error J0134

Interfaces cannot have constructors

The compiler detected an interface containing a constructor declaration. Because an interface cannot be instantiated, constructors cannot be defined for an interface. If you are defining a method with the same name as the interface, ensure that it has the appropriate modifiers to differentiate it from a constructor declaration.

The following example illustrates this error:

interface Simple {
   
   Simple();
   // error: interfaces cannot 
   // declare constructors
   
}