Java 17 ( JDK 17 ) new features | JEP 406: Pattern Matching for switch (Part 1)

preview_player
Показать описание
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 1)
Рекомендации по теме
Комментарии
Автор

What is your experience about java 17? Please share with us and say how good is java 17.

virtual_learning
Автор

Thank you for these recent series of videos on Java 17 features. I've shared them with my team to help us get up to speed on newer features.

NazNaziiii
Автор

I like these videos sooo much. They are infinitely nice to watch. Thank you!💓💟

NazNaziiii
Автор

Great tutorial . Of course this being a new feature its not supported in java 17, unless you run enable- preview. Which opens up a can of worms for your IDE.
I am sure they had a good reason to do this, and not just to make are life even tougher as devs.

tonycavanagh
Автор

Sir im using jdk 17 but still --> case null ...giving compilation error, Please advice me sir, thanks

shaiksajid