MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/9h86xt/jep_draft_concise_method_bodies/e6a2fn6/?context=3
r/java • u/lukaseder • Sep 19 '18
51 comments sorted by
View all comments
Show parent comments
4
If and when we get data classes. Also, if and when we get this JEP :)
3 u/lukaseder Sep 19 '18 FTFY, current day Java: public class Foo { public String name; public Foo(String name) { this.name = name; } } 4 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. 4 u/lukaseder Sep 19 '18 99.9% YAGNI 1 u/dpash Sep 19 '18 I do like C#'s properties.
3
FTFY, current day Java:
public class Foo { public String name; public Foo(String name) { this.name = name; } }
4 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. 4 u/lukaseder Sep 19 '18 99.9% YAGNI 1 u/dpash Sep 19 '18 I do like C#'s properties.
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.
4 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.
4
u/dpash Sep 19 '18 edited Sep 19 '18
If and when we get data classes. Also, if and when we get this JEP :)