20 */
21class ShapeDisplayer extends JFrame implements ActionListener, MouseListener {
22 private static final long serialVersionUID = -7036623560416033872L;
23 private static int x, y; 24 static ShapeIcon si = null;
25
26 /**
20 */
21class ShapeDisplayer extends JFrame implements ActionListener, MouseListener {
22 private static final long serialVersionUID = -7036623560416033872L;
23 private static int x, y; 24 static ShapeIcon si = null;
25
26 /**
This field appears to have the same name as a field in a super class.
This will prevent the superclass field from being accessed, and you will only be able to access the new field.
Rename the new field to avoid conflicts.
public class A {
public String firstValue;
public int secondValue;
}
public class B extends A {
public boolean firstValue; // Wasn't firstValue a string before?
}
public class A {
public String firstValue;
public int secondValue;
}
public class B extends A {
public boolean thirdValue;
}
This issue will not be raised for static fields, or when the parent class field is private.