Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class Shape {
int length;
int width;
public void setLength(int length) {
// access the instance variable
this.length = length;
}
public void setWidth(int width) {
// access the instance variable
this.width = width;
}
public void buildRectangle() {
// access the instance member method
this.setLength(5);
this.setWidth(4);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment