Skip to content

Instantly share code, notes, and snippets.

@ajduke
Created August 19, 2012 07:59
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/3393489 to your computer and use it in GitHub Desktop.
Save ajduke/3393489 to your computer and use it in GitHub Desktop.
Assigning the field name
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