Compiler Error J0043

Redeclaration of member 'identifier'

The compiler detected the same identifier name being declared more than once within the same scope. This error usually occurs when a variable or method is mistakenly declared more than once. Ensure that you have not declared a method or variable more than once in the same class. Methods can have the same name but must differ in method parameters in order to be different.

The following example illustrates this error:

public class Simple {
   private int i;
   public void method1(){
      //do something here
   }
   
   //Other declarations for the class go here
   
   private int i; // error: 'i' declared twice
   public void method1(){
      //error: method declared twice
   }
}