Compiler Error J0035

Initializer block cannot have modifiers except 'static'

The compiler detected a modifier other than static associated with an initializer. Use only the static keyword to specify the initializer as a static initializer or no modifier to signify that the initializer is an instance initializer. Remove the modifier from the initializer specified in the error message or add the static modifier to the initializer and compile again.

The following example illustrates this error:

public class Simple {
   protected{   // error: 'protected' is invalid here
      //do something here
   }
}