Created
August 19, 2012 08:19
-
-
Save ajduke/3393634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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