Basics, failure semantics on 26 vs 27, lazy collections, API across 25/26/27, preview-flag traps and a JMH read-path benchmark (jars fetched and sha1-checked, not committed). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
8 lines
277 B
Java
8 lines
277 B
Java
public class ReassignInSupplier {
|
|
public static void main(String[] args) {
|
|
// A LazyConstant has no set method: the only way to give it a value is the supplier passed to of().
|
|
LazyConstant<String> c = LazyConstant.of(() -> "x");
|
|
c.set("y");
|
|
}
|
|
}
|