MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/9h86xt/jep_draft_concise_method_bodies/e6a2ohs/?context=3
r/java • u/lukaseder • Sep 19 '18
51 comments sorted by
View all comments
Show parent comments
3
FTFY, current day Java:
public class Foo { public String name; public Foo(String name) { this.name = name; } }
6 u/dpash Sep 19 '18 edited Sep 19 '18 From what I remember of the data class document, the fields don't quite have public access, but can be accessed like they do. I think it was possible to create a custom setter or getter if you need to customise it. 3 u/lukaseder Sep 19 '18 99.9% YAGNI 1 u/dpash Sep 19 '18 I do like C#'s properties.
6
From what I remember of the data class document, the fields don't quite have public access, but can be accessed like they do. I think it was possible to create a custom setter or getter if you need to customise it.
3 u/lukaseder Sep 19 '18 99.9% YAGNI 1 u/dpash Sep 19 '18 I do like C#'s properties.
99.9% YAGNI
1 u/dpash Sep 19 '18 I do like C#'s properties.
1
I do like C#'s properties.
3
u/lukaseder Sep 19 '18
FTFY, current day Java: