Compiler Error J0206

Cannot assign a second value to blank final variable 'identifier'

The compiler detected an attempt to assign a value to a final variable more than once. This error usually occurs when a blank final variable is initialized more than once in a constructor or initializer. Check for duplicate initializations of the final variable mentioned in the error message and compile again.

The following example illustrates this error:

public class Simple{
   final int var1;
   
   {
      var1 = 10;
      //Do other initializations here
      var1 = 20; //error: duplicate assignment
   }
}