Java 11 – Nest-Based Access Control

This JEP 181: Nest-Based Access Control, supports private access within nest members directly, no more via an auto-generated bridge method access$000. Furthermore, new nest APIs for validation and allowed private reflection access within nest members. P.S No need to change the code, it is a Java compiler’s optimization to remove the bridge method access. 1. …

Read more

Java 13 – Switch Expressions

In Java 13, the JEP 354: Switch Expressions extends the previous Java 12 Switch Expressions by adding a new yield keyword to return a value from the switch expression. P.S Switch expressions are a preview feature and are disabled by default. Note This is a standard feature in Java 14. 1. No more value breaks! …

Read more

Java 12 – Switch Expressions

Java 12, JEP 325: Switch Expressions enhanced the traditional switch statement to support the following new features: Multiple case labels Switch expression returning value via break (replaced with yield in Java 13 switch expressions) Switch expression returning value via label rules (arrow) P.S Switch expressions are a preview feature and are disabled by default. A …

Read more