Популярное

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

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

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

Топ запросов

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

instanceof Java Keyword Tutorial | What's new?

Автор: MVP Java

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

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

Описание:

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

instanceof Java Keyword Tutorial | What's new?

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

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

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

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

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

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

array(10) { [0]=> object(stdClass)#5758 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "0yb80kTO2UQ" ["related_video_title"]=> string(22) "What is a Java Record?" ["posted_time"]=> string(19) "5 лет назад" ["channelName"]=> string(8) "MVP Java" } [1]=> object(stdClass)#5731 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "HpuH7n9VOYk" ["related_video_title"]=> string(49) "Upcasting and Downcasting in Java - Full Tutorial" ["posted_time"]=> string(21) "3 года назад" ["channelName"]=> string(16) "Coding with John" } [2]=> object(stdClass)#5756 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "wIvDgsUHQVo" ["related_video_title"]=> string(36) "instanceof Java Keyword Tutorial #90" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(8) "Alex Lee" } [3]=> object(stdClass)#5763 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "qRuGoUy5fUI" ["related_video_title"]=> string(44) "How to use var keyword in java - Brain Bytes" ["posted_time"]=> string(19) "6 лет назад" ["channelName"]=> string(11) "Java Brains" } [4]=> object(stdClass)#5742 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "ePFWoOnyYHc" ["related_video_title"]=> string(42) "Inheritance (extends) | Java | Tutorial 34" ["posted_time"]=> string(19) "7 лет назад" ["channelName"]=> string(15) "Giraffe Academy" } [5]=> object(stdClass)#5760 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "m4ETS8Dqgoo" ["related_video_title"]=> string(122) "Атака РФ на американский корабль? / Мир приблизился к ядерной войне" ["posted_time"]=> string(23) "9 часов назад" ["channelName"]=> string(10) "NEXTA Live" } [6]=> object(stdClass)#5755 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "blWdjRUPP6E" ["related_video_title"]=> string(72) "Разведчик о том, как использовать людей" ["posted_time"]=> string(25) "2 недели назад" ["channelName"]=> string(18) "Коллектив" } [7]=> object(stdClass)#5765 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "nec3aZM8aUY" ["related_video_title"]=> string(83) "Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(7) "Diamond" } [8]=> object(stdClass)#5741 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "Okq--FagHHA" ["related_video_title"]=> string(146) "⚡️ Жуткий удар по столице || Решающая атака Ирана || Москва выдвинула ультиматум" ["posted_time"]=> string(23) "9 часов назад" ["channelName"]=> string(23) "Время Прядко" } [9]=> object(stdClass)#5759 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "nWTLJP7BzAc" ["related_video_title"]=> string(95) "Трамп не пощадил лицо Зеленского на Большой Семерке" ["posted_time"]=> string(21) "2 часа назад" ["channelName"]=> string(27) "Анатолий Шарий" } }
What is a Java Record?

What is a Java Record?

Upcasting and Downcasting in Java - Full Tutorial

Upcasting and Downcasting in Java - Full Tutorial

instanceof Java Keyword Tutorial #90

instanceof Java Keyword Tutorial #90

How to use var keyword in java - Brain Bytes

How to use var keyword in java - Brain Bytes

Inheritance (extends) | Java | Tutorial 34

Inheritance (extends) | Java | Tutorial 34

Атака РФ на американский корабль? / Мир приблизился к ядерной войне

Атака РФ на американский корабль? / Мир приблизился к ядерной войне

Разведчик о том, как использовать людей

Разведчик о том, как использовать людей

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

⚡️ Жуткий удар по столице || Решающая атака Ирана || Москва выдвинула ультиматум

⚡️ Жуткий удар по столице || Решающая атака Ирана || Москва выдвинула ультиматум

Трамп не пощадил лицо Зеленского на Большой Семерке

Трамп не пощадил лицо Зеленского на Большой Семерке

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



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



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