Files

7 lines
382 B
Java

/** JEP 539 (preview in JDK 28): a JVM field flag. javac sets it on value-class fields; an identity class is the control. */
public class StrictFieldProbe {
static value class Money { final long cents; Money(long c) { cents = c; } }
static class Legacy { final long cents; Legacy(long c) { cents = c; } }
public static void main(String[] args) { new Money(1); new Legacy(1); }
}