Тёмный

Java 8 Interview Questions And Answers | Consumer || BiConsumer || Supplier || Chaining (Live Demo) 

Code Decode
Подписаться 136 тыс.
Просмотров 100 тыс.
50% 1

Java 8 part 4 New Features Interview Questions And Answers Live Demo
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
Java 8 Interview Questions Complete Playlist :
• Java 8 Interview Quest...
Consumer : It will consume Item. Consumers never return anything (never supply), they just consume.
Consumer Chaining :
We can combine / chain multiple consumers together with andThen .
There is only one ways to combine consumers:
c1.andThen(c2).apply(Input); - first c1 then c2
No compose() in consumer.
Multiple consumers can be chained together like :
c1.andThen(c2).andThen(c3).andThen(c4).apply(Inputs);
Supplier :
It will just supply required objects and will not take any input
Its always going to supply never consume / take any input.
EG : always supply me current date.
No chaining as no input is given to this. Only it gives u output.
Advantages:
Write once, use anywhere.
Code Reusability
BiCinsumer Bisupplier :
What if we need 2 arguments for operation?
Then we need Bi XYZ Functional Interfaces.
There is no input in supplier so no 1 or 2 Input arguments needed. Hence no BiSupplier.
Q) If we want to operate on 3 arguments then triPredicate?
There are no TriPredicate or TriFunction etc.
No QuadPredicate No QuadFunction.
Java 8 has inbuilt Functional interfaces that can take only 1 or 2 arguments no more.
-------------------------------------------------------------------------------------------------------------------------------------
Code Decode Playlists
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
GIT : • GIT
-------------------------------------------------------------------------------------------------------------------------------------
Subscriber and Follow Code Decode
Subscriber Code Decode : www.youtube.co...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
--------------------------------------------------------------------------------------------------------------------------------------
#Java8 #Java8Consumer #Java8Supplier #codedecode

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 146   
Далее
ОБЗОР НА ШТАНЫ от БЕЗДNA
00:59
Просмотров 263 тыс.
ОБЗОР НА ШТАНЫ от БЕЗДNA
00:59
Просмотров 263 тыс.