Compiler Error J0270

The compiler detected an ambiguous reference to a field. This error usually occurs when a class's superclass and an interface the class implements have the same field declared. The compiler cannot determine which instance of the field to use. Ensure that you do not have a superclass and implemented interface that have the same field defined and compile again.

The following example illustrates this error:

public class Simple extends SuperClass implements SuperInterface{
   public static void main (String args[]){
      float x = var1; /*error: cannot determine which instance of 'var1'
                               to use */
   }
}

class SuperClass{
   float var1;
}

interface SuperInterface{
   float var1=6.0f;
}