Fading Coder

One Final Commit for the Last Sprint

Replacing Internal sun.font.FontDesignMetrics When Upgrading to JDK 17

When upgrading a project from JDK 1.8 to JDK 17, the following code: FontMetrics fontMetrics = FontDesignMetrics.getMetrics(font); Throws an error: cannot access class sun.font.FontDesignMetrics (in module java.desktop) because module java.desktop does not export sun.font The most common solution fo...

Key Language Features Introduced in JDK 17

Yield Keyword in Switch Expressions Starting from Java 13, the yield keyword enhances switch expressions by allowing them to return values. This feature simplifies code by eliminating the need for explicit break statements and separate variable assignments. Traditional switch statement: public class...