Skip to content

Instantly share code, notes, and snippets.

@DavidTPate
Last active August 29, 2015 13:56
Show Gist options
  • Save DavidTPate/9041687 to your computer and use it in GitHub Desktop.
Save DavidTPate/9041687 to your computer and use it in GitHub Desktop.
// Using the Telescoping Constructor anti-pattern
Car carSearchCriteria = new Car(1998, null, "Focus", "Sedan");
// Using the Builder Pattern
Car carSearchCriteria = new Car.Builder().year(1998)
.model("Focus")
.carType("Sedan")
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment