Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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