class Rectangle {
int x;
int y;
int width;
int height;
public int getX() {
return this.x;
}
public int getY() {
return this.y;
}
public int setX(int x) {
this.x = x;
}
public int setY(int y) {
this.y = y;
}
// etc etc
}
// In another class you'd have:
Rectangle r1;
r1.setX(50);
int example = r1.getX();