Compiler Error J0236

'identifier' is not a nested class or interface in class 'identifier'

The compiler detected a reference to a nested class or interface but the nested class or interface does not exist in the specified class. This error usually occurs due to a syntactical error in referencing a nested class or interface. Check the reference to the inner class for syntax errors and ensure that the class or interface exists inside the specified class, and compile again.

The following example illustrates this error:

class NotSimple{
}

public class Simple{
   void method1(){
      NotSimple nt = new NotSimple();
      Object o = nt.new InnerClass();
      //error: 'InnerClass' is not an inner class of 'NotSimple'
   }
}