Compiler Error J0248

#endif without matching #if

The compiler detected a #endif conditional compilation directive, but did not detect a matching #if directive. This error usually occurs because an extra #endif directive was supplied. This error can also occur when a #if conditional compilation directive was deleted or commented out but the matching #endif directive was not deleted. Ensure that you have matching directives and compile again.

The following example illustrates this error:

public class Simple{
   public void method1(){
      //#if SIMPLE
      //do something here
      #if DEBUG
          //do something here
          #if WIN95
             //do something here
          #endif
      #endif
      #endif //error: extra '#endif' directive not permitted
   }
}