Scoped Values in Java
Scoped values are a new way to share data between threads without using method parameters. They also use less memory compared to Thread local variables.
What is a Scoped Value Scoped values are a new addition to the Java language. I was first introduced as an incubating feature in Java 20 as JEP 429, as a preview feature in Java 21 in JEP 446, and is currently in the second preview round in Java 22 as JEP 464 .