Minor typo in the linked site:
"JDK 20 reached General Availability on 21 March 2022"
Should be 21 March 2023
Not sure who can edit that page but putting here.
"JDK 20 reached General Availability on 21 March 2022"
Should be 21 March 2023
Not sure who can edit that page but putting here.
Object obj = 123L;
String formatted = switch (obj) {
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
case Double d -> String.format("double %f", d);
case String s -> String.format("String %s", s);
default -> o.toString();
};
Unless I'm not understanding something, the default statement should be `obj.toString()` as `o` isn't defined.The Billion Dollar Mistake meets the Power of Compounding Interest to produce an inflation adjusted number that just keeps on giving
See [1] for more.