We solve the ambiguity issue by explicitly reference the ivarwidth using this.
Java looks in the smaller/local context (method context) before looking in a higher context (class context). That's why it finds the method parameter "width" before the ivar "width".
public class Rectangle {
private int width;
private int height;
public void setWidth1(int width) {
this.width = width
}
}
Introduction To Objects With Java
(Chapter 408 - Special Variable 'this')