Skip to content

Instantly share code, notes, and snippets.

@ajduke
Created August 19, 2012 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajduke/3393634 to your computer and use it in GitHub Desktop.
Save ajduke/3393634 to your computer and use it in GitHub Desktop.
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