Skip to main content
9 votes
1 answer
152 views

JEP 455 introduced Primitive Types in Patterns, instanceof, and switch as a preview feature in JDK 23. It continues as a preview feature in JDK 24 and 25, so the feature is not detailed in the Java ...
Speakjava's user avatar
  • 3,510
1 vote
0 answers
51 views

I am using Disjoint Set Union (DSU) and Union Find to solve a graph problem. The entry point function takes an input string with coordinates defined by (line number, char number), starting at the top ...
PacificNW_Lover's user avatar
1 vote
1 answer
93 views

I try to update java version from 22 to 23. We work with off-heap memory: val intVh = MemoryLayout .sequenceLayout( Long.MaxValue / ValueLayout.JAVA_INT.byteSize(), ValueLayout....
Person Person's user avatar
0 votes
0 answers
123 views

I have an old android project and I am on the process of shifting to AndordX and updated gradle. When I build the project I receive the below error for some dependency, what could possibly be the ...
Gabriel Rogath's user avatar
21 votes
1 answer
1k views

In Java 21 and 23, java.net.InetAddress is declared public sealed class InetAddress implements Serializable permits Inet4Address, Inet6Address { However, the following code: switch (addr) { case ...
Aleksandr Dubinsky's user avatar
10 votes
1 answer
1k views

I am trying the following code for performance checking. It is purely CPU-bound, doing lots of calculations on double types, single-threaded, and does not use any heap: public class PerfTestSampleJ { ...
k314159's user avatar
  • 12.4k
10 votes
1 answer
867 views

Why does this code lead to a java.lang.IllegalThreadStateException? newSingleThreadScheduledExecutor(Thread::startVirtualThread).scheduleWithFixedDelay( () -> System.out.println("Hello, ...
xtay2's user avatar
  • 988
1 vote
1 answer
314 views

I'm exploring Java Stream Gatherers, a preview feature introduced in Java 22, and I'm using Java 23 with preview features enabled for this purpose. My primary goal here is to better understand how the ...
Faisal Khan's user avatar
4 votes
1 answer
179 views

I had an interview today, and the interviewer presented the following code. They asked what the output would be in Java 8 and the latest version of Java. From my understanding, since B is an inner ...
maplemaple's user avatar
  • 1,805
8 votes
1 answer
694 views

Java 23 now allows Markdown Documentation Comments I am experimenting with this feature right now in latest IntelliJ IDEA 2024.2.2 (community) and with GraalVM for JDK 23 as Java runtime. It seems the ...
Ellrohir's user avatar
  • 2,014