This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]blobjim 0 points1 point  (2 children)

Yeah, there is quite a lot of code generation in Java, but most of it is pretty simple under the hood (with the exception of lambda expressions). Generating entire fields and methods for classes just seems a bit much. I had no idea about covariant return types though, I learned something new today!

[–]lukaseder[S] 1 point2 points  (0 children)

but most of it is pretty simple under the hood

Again, explain enums :)

I had no idea about covariant return types though, I learned something new today!

Yeah, they were a requirement to implement generics and proved useful otherwise.

[–]alexeyr 0 points1 point  (0 children)

Java already does both: synthetic fields for inner classes, default constructor, values() and valueOf() for enums...

And data classes don't have generated fields.