Created
August 19, 2012 07:59
-
-
Save ajduke/3393489 to your computer and use it in GitHub Desktop.
Assigning the field name
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; | |
private Shape(int length, int width) { | |
// access member variable incase the | |
// field name and parameter name are same | |
this.length = length; | |
this.width = width; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment