Compiler Error J0235

'identifier' is not a method in class 'identifier'

The compiler detected a method call but the method does not exist in the specified class. This error usually occurs when the method call is called incorrectly or the method call was meant to reference a method in a different class. Ensure that the method exists in the specified class, that your method call is syntactically correct, and compile again.

The following example illustrates this error:

class Simple{
   public void method1(){
      //do something here
   }
}

class Simple2{
   public void method1(){
      Simple smp = new Simple();
      smp.method2();
      //error: 'method2' does not exist in the class 'Simple'
   }
}