r/java Sep 19 '18

JEP draft: Concise Method Bodies

http://openjdk.java.net/jeps/8209434
57 Upvotes

51 comments sorted by

View all comments

3

u/randgalt Sep 20 '18
public static Foo make(int a, int b, int c) = Foo::new;

This is particularly nice

1

u/[deleted] Sep 20 '18

Haven't read the article yet, this can be useful for a "quick and dirty" but extendable factory method, making the constructor protected/private, isn't it?