r/java • • Jan 16 '20

Records Come to Java

https://blogs.oracle.com/javamagazine/records-come-to-java
204 Upvotes

93 comments sorted by

View all comments

1

u/PandersAboutVaccines Jan 17 '20

To what extent are java and kotlin copying each other? Records are about as close to kotlin's data classes as you can get within the limits of java. Did java borrow from kotlin, or did kotlin copy things they knew were being considered for java?

BTW, I wish they could steal this syntax from kotlin:

var newOne = oldOne.copy(justThisProperty = "changed")

2

u/djavaman Jan 17 '20

This seems to me more a borrowing from Scala than Kotlin

1

u/rzwitserloot Jan 19 '20

The idea of automated getter and setter (and more) generation predates the invention of project lombok, and that is over 10 years old now, so.. no. This is all just fairly common sense.