The matching syntax looks really good to me:<p><pre><code> // Java 21
if (obj instanceof Point(int x, int y)) {
System.out.println(x+y);
}
// Older Java
if (obj instanceof Point p) {
int x = p.x();
int y = p.y();
System.out.println(x+y);
}</code></pre>
> Java collections don’t have a type representing an ordered sequence of elements, Java 21 fills this gap by introducing the SequencedCollection, SequencedSet and SequencedMap interfaces. These interfaces provide methods for adding, modifying or deleting elements at the beginning or end of the collection, as well as for iterating over a collection in reverse order.<p>That sounds like a deque, and it's been in Java for a long time. (No set or map implementations though.)<p><a href="https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/util/Deque.html" rel="nofollow noreferrer">https://docs.oracle.com/en/java/javase/18/docs/api/java.base...</a>
For those in the ecosystem these days - is there a compelling reason to choose Java over Kotlin? I am under the impression that Kotlin is a better Java without any sacrifices. Is this true?
I can't wait until major frameworks (such as Spring in version 6.1) support virtual threads. Reactive programming (e.g., Webflux) would become a niche (unless your use case truly requires streaming with a high number of TPS).
Are StringTemplates constant? i.e. for this method:<p>StringTemplate foo() {
return RAW."";
}<p>is foo() == foo()?<p>This is a very useful feature of JS tagged template functions, as it lets a template processor do expensive one-time processing of a StringTemplate and cache the result, then use that to quickly apply that to particular values. I don't see an answer here: <a href="https://cr.openjdk.org/~jlaskey/templates/docs/api/java.base/java/lang/StringTemplate.html" rel="nofollow noreferrer">https://cr.openjdk.org/~jlaskey/templates/docs/api/java.base...</a>
Would be cool if there were an easy way to add primitives to Java. I would like a 128-bit integer that the JVM could handle with `add` + `adc` and friends. If I could extend my JVM trivially by linking in a `.so` that enabled it to handle the primitive it would be pretty sick. I imagine that's not really that easy to do, but a nice wide primitive that could be used for fixed point arithmetic would be nice to have.
Anyone knows when the Java 21 LTS certification book will be out (“OJP exam” or something like that)?<p>I’m tempted to pass the exam with Java 17, since the wait for Java 21 will be too long, assuming it will be several months after the GA date, September 21st.
For a while I was only interested in newer Java releases just to see if Runescape ran on it :p<p>The usefulness seemed to cut-off with Java 11 though and now the RS Java client is being deprecated.
It remains a bit bitter sweet to see that so many features that we’ve had for 13+ years in Scala and longer in languages like Haskell and were ridiculed back then, now find their way to mainstream Java.
> JEP-448 – Vector API: sixth incubation of this feature. This new version includes bugfixes and performance improvements.<p>Rant:<p>JFC Java, its 2023 and people use Java to run actual databases and develop machine learning infrastructure. Yet the ability to do SIMD in the JVM is on its <i>sixth</i> incubation.