Compiler Error J0260

Cannot declare an interface method to be 'protected' or 'private'

The compiler detected an interface with a method declared as protected or private. Interface methods must be declared as either public or with no access modifier (default). Change the interface method declaration specified in the error so that it is not declared protected or private and compile again.

The following example illustrates this error:

interface ISimple{
   public void method1(); //this is OK!
   void method2(); //this is OK! Declared as "default" access
   protected void method3(); /*error: cannot declare interface method as
                                      protected */
   private void method4(); /*error: cannot declare interface method as
                                    private */
}