Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Patterns.dev. Parent comment
Let’s remove the category argument and you get this:
Post post = new Post.Builder() .title("Java Builder Pattern") .text("Explaining how to implement the Builder Pattern in Java") .build();
Post post = new Post("Java Builder Pattern", "Explaining how to implement the Builder Pattern in Java", null);
Post post = new Post(title: "Java Builder Pattern", text: "Explaining how to implement the Builder Pattern in Java");
Let’s remove the category argument and you get this:
This builder is a more readable alternative to this: But if Java supported named arguments and default values (the default would be null), this could just be: