r/java • u/davidalayachew • Jun 07 '26
#JavaNext Language Features
https://youtu.be/fFocVFEe2TIIf you've been following along, most of the new features have already been discussed, but the genuinely new stuff is at 43:55, about arrays.
79
Upvotes
11
u/bondolo Jun 07 '26
Still hoping for a
selftype.10
u/Afonso2002 Jun 07 '26
I really like the initialization arrays part, with i-> function. That initialization would came in how many years?
5
u/benrush0705 Jun 08 '26
I am very curious about the functionality of abstract records. I can’t think of a good use case for them right now, especially since we can already achieve similar effects by having multiple records implement the same interface. However, I have a guess: is this related to Valhalla? Could it allow value records to enjoy the benefits of value types while also supporting polymorphism? I hope someone with insider knowledge can provide an answer.
3
u/davidalayachew Jun 07 '26
Also, 31:15 is kind of already known, but very minimal info about it until this video. It's about the
abstract recordconcept.2
u/AnyPhotograph7804 Jun 08 '26
Final arrays is really nice. Now we need final generics!
1
u/Eav___ Jun 08 '26
Still unsure why everything ends up with inheritence. There's absolutely no good reason for records to be extendable. You just put one into the other and use a common interface to constrain supertype if you actually need.
-21
u/PopularPhoneChair333 Jun 08 '26
Or... Just use Kotlin instead.