Java 14 new features | Pattern matching for instance of operator in JDK 14

Опубликовано: 26 Сентябрь 2020
на канале: Java Beam
401
5

This video explains you with real time example, how you can write a java code using instanceof operator and with using pattern matching for instanceof operator. And also explains the problem/redundent with old approach.

Java 14 new features | Pattern matching for instance of operator in JDK 14

Use pattern matching for instanceof operator to simplify the use of the instanceof operator in Java, thereby making your code safer and more easier to write.

Many Java developers use the instanceof operator to compare a reference variable to a type. If the result is true, the next obvious step is to explicitly type cast it to the type they compared it with, to access its members. These steps have a repetition: compareTo.
This step is redundent. this step can be avoided when you start using the pattern matching for instnce of operator in java 14


#JavaBeam #Java14NewFeatures #InstanceOfOperatorInJava14 #Java


Смотрите видео Java 14 new features | Pattern matching for instance of operator in JDK 14 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Java Beam 26 Сентябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 401 раз и оно понравилось 5 людям.