Tagged articles
Switch Expression
10 articles · Page 1 of 1
The article shows how a Java 14 switch expression combined with a BiFunction and method references can replace duplicated if‑else branches in inventory‑change code, reducing maintenance effort and lowering the risk of missed updates when new types are added.
BiFunctionJavaMethod Reference
0 likes · 7 min read

This article traces the evolution of Java's switch statement from a cumbersome statement to a modern expression, detailing the six shortcomings of the traditional switch, the introduction of arrow syntax and preview mode in Java 12, the yield keyword in Java 13, the standardization in Java 14, and the powerful pattern‑matching and null‑handling features added in Java 17, while providing concrete code examples and practical guidance.
Code ExamplesJavaJava 17
0 likes · 19 min read


政采云技术Jan 25, 2024 · Fundamentals
This article provides a comprehensive overview of the major language and runtime enhancements introduced in JDK 12 through JDK 17, covering switch expressions, micro‑benchmarking with JMH, class‑data sharing, garbage‑collector improvements, new String methods, hidden and sealed classes, records, and unified asynchronous logging, all illustrated with code examples.
JDKJMHJava
0 likes · 23 min read

The article reviews the most notable Java 17 language enhancements—including text blocks, records, concise switch expressions, pattern‑matching instanceof, sealed classes, and richer NullPointerException messages—explaining their syntax, benefits, and providing side‑by‑side code comparisons with Java 11.
Java 17RecordsSealed Classes
0 likes · 9 min read

This article explains Java 14’s revamped switch expression syntax—including the concise case‑label arrow, the new yield keyword for returning values, and improved NullPointerException messages—showing how these changes simplify code and make debugging clearer.
JavaJava 14Switch Expression
0 likes · 6 min read

This article explains how to use Java 17 features such as pattern matching and switch expressions in IntelliJ IDEA 2021.2.1, demonstrates performance‑boosting tips by disabling unnecessary plugins, and provides practical code examples to streamline your Java development workflow.
IntelliJ IDEAJava 17Switch Expression
0 likes · 4 min read

This article introduces the JDK 14 release, lists its sixteen new features—including pattern‑matching instanceof, switch expressions, record types, and text blocks—explains required IDE support, and provides concrete code examples and usage guidelines for each feature.
New FeaturesRecordsSwitch Expression
0 likes · 8 min read

The article introduces the major Java 14 enhancements—including standard switch expressions, preview pattern matching for instanceof, more informative NullPointerExceptions, preview records, text blocks, and several JVM and library improvements—while providing code examples that illustrate how each feature simplifies Java development.
JEPJava 14NullPointerException
0 likes · 6 min read

This article walks through modernizing a Java switch statement—from the traditional switch with breaks to the concise switch expression introduced in JDK 12, covering enum handling, the new arrow syntax, the yield keyword, compiler warnings, and practical code examples.
Code TutorialJDK13Java
0 likes · 9 min read

This article provides a comprehensive English summary of JDK 13's new features—including switch expression enhancements, text‑block syntax, dynamic CDS archives, ZGC memory reclamation, revamped socket APIs, new FileSystems methods, updated NIO ByteBuffer operations, the Reiwa era in java.time, Unicode 12.1 support, GC improvements, security updates, and removed legacy functionalities—accompanied by original Java code examples.
CDSJavaNIO
0 likes · 11 min read
