3 ms·
>It's $CURRENTYEAR and Java still doesn't support structs they call it records, added recently. Depending on where you work, you may see them in a decade
by fiedzia 2y ago
>It's $CURRENTYEAR and Java still doesn't support structs
they call it records, added recently. Depending on where you work,
you may see them in a decade
- cogman10 2y agorecords aren't the structs OP is referring to. Instead, they are thinking of value classes. (at least, that's effectively what a struct means in C#). You will see `value record Point(int x, int y)` which is different from `record Point(int x, int y)`. The key difference being that `record Point` will create a reference to the x/y data with identity whereas `value record Point` will instead represent that data inline without a reference. I suspect that `value record` will be the way pretty much everyone starts using `record` as there's basically no reason not to.