ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

instanceof Java Keyword Tutorial | What's new?

java 14 preview feature

instanceof in java 14

Java 14 instanceof Operator

instanceof alternative

Java 14 pattern matching for instanceof

instanceof and casting

java 14 new features

java instanceof example

instanceof operator

instanceof in java

instanceof keyword

java instanceof operator

java 14 pattern matching

pattern matching for instanceof

instanceof java

instanceof

instanceof java tutorial

java instance

java

mvpjava

java downcasting

java upcasting

Автор: MVP Java

Загружено: 2020-06-03

Просмотров: 338

Описание: Learn what's new with the Java 14 instanceof operator. Java 14 now supports Pattern Matching as a preview feature when using the instanceof operator... but Hold Up! A word of caution before blindly using this new features in your code.

The instanceof operator in Java 14 has been extended to allow for what's called a "test type pattern" which allows for Pattern Matching to be used. This test type pattern is a combination of a predicate that specifies a Type (like instanceof Type) and a binding variable (that's what is new here).

No more explicit casting and no more declaration of local variables, less boilerplate code .. great! Just be aware that there are some scoping rules with the new binding variable that are well described in the JEP 305 .

Although Java 14's new instanceof feature is great, we should remember that sometimes using instanceof can be considered a code smell or an anti-pattern. I will cover when to use and not use instanceof as well as offer some alternatives.

Check out the MVP Java blog post here:
http://mvpjava.com/instanceof-java-14

00:00 Introduction
01:58 Project Code walk through for instanceof demo | pre Java 14
05:06 New Java 14 instanceof preview feature explained
08:16 Alternatives to instanceof | Best OO practice
09:33 When to use instanceof | Use cases
10:10 When to not use instanceof | Polymorphism


Resources:
-------------------------------------------------------------
JEP 305: Pattern Matching for instanceof (Preview):
https://openjdk.java.net/jeps/305


Java Magazine: Pattern Matching for instanceof in Java 14
https://blogs.oracle.com/javamagazine...


Other MVP Java Videos and Posts on Java preview features:
----------------------------------------------------------------
Java Records | Boilerplate Exterminator:
Blog: http://mvpjava.com/java-records/
YouTube:    • What is a Java Record?  

JDK 12 Switch Expression – Preview Feature
Blog: http://mvpjava.com/jdk-12-switch/
YouTube:    • Java 12 Switch Expression - Preview Feature  

Code available on GitHub here:
https://github.com/mvpjava/java14-ins...


======================================================

Subscribe to MVP Java ...
https://www.youtube.com/c/MVPJava?sub...

Follow me ...
Website : http://www.mvpjava.com
Facebook :   / mvpjava  
Twitter :   / mvpjava  
GitHub : https://github.com/mvpjava
DockerHub: https://hub.docker.com/?namespace=mvp...
My Company: http://www.triomni-it.com

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
instanceof Java Keyword Tutorial | What's new?

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]