Compiler Error J0113

Call to constructor must be first statement in constructor

The compiler detected a constructor called from within the body of a second constructor, but the constructor call was not placed at the beginning of the second constructor body. In a constructor, calls to another constructor must be the first line of code in the constructor's body. Ensure that the constructor call is the first line of code in the constructor body and compile again.

The following example illustrates this error:

public class Simple {
   
   int i, j;
   Simple () {
   
      i = 0;
   }
   
   Simple(int arg1) {
   
      j = arg1;
      this(); // error: call to Simple() must be first
   }
}