Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// simple constructor
//
private final int x;
private final int y;
private final String z;
public MyClass(int x, int y, String z) {
this.x = x;
this.y = y;
this.z = z;
}
// complex building
//
public static MyClass create(List<Stuff> list, Set<Stuff> set) {
// int x = some brains...
// int y = more brains...
// other brains...
// String z = more complex stuff here
//
return new MyClass(x, y, z);
}
private final int x;
private final int y;
private final String z;
private MyClass(int x, int y, String z) {
this.x = x;
this.y = y;
this.z = z;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.