DEV Community

Cover image for Interesting JDK 12 features to watch out for.

Interesting JDK 12 features to watch out for.

Lemuel Ogbunude on November 09, 2018

With the new 6 months Java release cycle, you should expect cool features to get to developers at a faster rate. I have seen some cools features wh...
Collapse
 
emlautarom1 profile image
Martín Emanuel

Thank God for 'record'. Adding and maitaining get/set/equals/etc is always an unnecesary pain for us. At first glance this looks like Kotlin, and I really like it!

Collapse
 
gazsiadam profile image
Adam Gazsi

Have you tried Lombok? Does the same thing, and even more. projectlombok.org/

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Thanks for the info Adam. I didn't know about Lombok! Looks really cool.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Haha, yeah at first glance it does look like Kotlin. Glad you like it.

Collapse
 
lysofdev profile image
Esteban Hernández

StuckWithJava8 :(

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Trust me, I know that feeling :(

Collapse
 
simonhaisz profile image
simonhaisz

Record is not listed as a proposed JEP for 12: openjdk.java.net/projects/jdk/12/

In fact I cannot find it anywhere in the JEP list: openjdk.java.net/jeps/0

EDIT: I scanned through the video to find the section on record - unlike Switch Expressions and Raw String Literals there was no slide that provided a JEP. Looks like it's more of a JDK 13+ thing, don't expect it in 12.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Sorry I didn't mention that Records are currently not in the preview features, was probably too excited :) Thank you for that.
Currently, there are 4 JEPs targeted to JDK 12 so far which are Switch Expressions, Raw String literals and two others.
It might be more of a JDK 13+ thing as you said though with the faster 6 months release cycle that wouldn't be an issue of waiting for 3+ years any longer :)

Collapse
 
gklijs profile image
Gerard Klijs

It is when your company sticks to lts releases, witch is still better than companies stuck on Java 8.

Collapse
 
marconicolodi profile image
Marco Nicolodi

I would love to have this record feature in c#

Collapse
 
saint4eva profile image
saint4eva

You should check the upcoming C#

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

I'm sure that would be awesome...

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Yeah, it's a nice feature, probably could be added as the language evolves.

Collapse
 
ozeta profile image
Marco Carrozzo

record seems really useful. but what about class extention? how will this work? it will support override,overload?

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Yes, you can override the methods you want to and customise it to your taste, in the video I provided there was a demo showing that you could also override a method, for example, ToString() to your requirement.

Collapse
 
ahierro profile image
ahierro

They are getting close to Scala now. I hope they do something about pattern matching in future releases.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

You could expect cool features anytime soon :)