filmov
tv
Java 17 ( JDK 17 ) new features | JEP 406: Pattern Matching for switch (Part 3)
Показать описание
In these tutorial series we will talk about Java 17 (JDK 17) new features specially about JEP 406: Pattern Matching for switch.
Enhance the Java programming language with pattern matching for switch expressions and statements, along with extensions to the language of patterns. Extending pattern matching to switch allows an expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely. In Java 16, JEP 394 extended the instanceof operator to take a type pattern and perform pattern matching.This JEP builds on pattern matching for instanceof (JEP 394) and also the enhancements offered by switch expressions (JEP 361). We intend this JEP to coincide with JEP 405, which defines two new kinds of patterns that support nesting. The implementation will likely make use of dynamic constants (JEP 309)
switch expressions and statements, guarded patterns , parenthesized patterns , switch-like expression , pattern-matching semantics , traditional switch construct , multi-way comparisons with switch statements , Java 14, switch expressions (JEP 361), switch is a perfect match for pattern matching , Pattern matching and null , Refining patterns in switch , Patterns in switch labels , Enhanced type checking , Selector expression typing , Dominance of pattern labels , compatibility of an expression with a pattern , Completeness of pattern labels in switch expressions and statements , selector expression is a sealed class (JEP 409), Scope of pattern variable declarations , Dealing with null , Matching null , New label forms arising from null labels , Guarded and parenthesized patterns ,
Java 17 ( JDK 17 ) new features | JEP 406: Pattern Matching for switch (Part 3)
Enhance the Java programming language with pattern matching for switch expressions and statements, along with extensions to the language of patterns. Extending pattern matching to switch allows an expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely. In Java 16, JEP 394 extended the instanceof operator to take a type pattern and perform pattern matching.This JEP builds on pattern matching for instanceof (JEP 394) and also the enhancements offered by switch expressions (JEP 361). We intend this JEP to coincide with JEP 405, which defines two new kinds of patterns that support nesting. The implementation will likely make use of dynamic constants (JEP 309)
switch expressions and statements, guarded patterns , parenthesized patterns , switch-like expression , pattern-matching semantics , traditional switch construct , multi-way comparisons with switch statements , Java 14, switch expressions (JEP 361), switch is a perfect match for pattern matching , Pattern matching and null , Refining patterns in switch , Patterns in switch labels , Enhanced type checking , Selector expression typing , Dominance of pattern labels , compatibility of an expression with a pattern , Completeness of pattern labels in switch expressions and statements , selector expression is a sealed class (JEP 409), Scope of pattern variable declarations , Dealing with null , Matching null , New label forms arising from null labels , Guarded and parenthesized patterns ,
Java 17 ( JDK 17 ) new features | JEP 406: Pattern Matching for switch (Part 3)
Комментарии