WEBVTT

0
00:00.210 --> 00:05.420
Hi Everyone,  Welcome come back to the tutorial. In this tutorial we will talk about functional interfaces.

1
00:05.460 --> 00:10.620
We touched on this topic a bit in the previous tutorial. Lets dig in further and discuss more in

2
00:10.620 --> 00:18.070
this tutorial. Function interfaces are something which are present in Java since JDK 1.0 and

3
00:18.090 --> 00:22.380
those were referred as Single Abstract Method Interfaces (SAM).

4
00:22.410 --> 00:30.030
The concepts are the same but those are categorized into a new modernized category which is called functional

5
00:30.240 --> 00:31.710
interfaces.

6
00:31.730 --> 00:39.000
As per the Java documentation the definition of functional interfaces is that any interface that has exactly

7
00:39.010 --> 00:40.460
one abstract method.

8
00:40.590 --> 00:44.880
Those are categorized as functional interfaces.

9
00:44.940 --> 00:50.880
We have seen this annotation called our @Functionalinterface which got introduced in Java 8.

10
00:51.390 --> 00:59.210
And all the interfaces which has one abstract method are annotated with  @Functionalinterface.

11
01:00.160 --> 01:03.620
This is an optional annotation but it does validate

12
01:03.670 --> 01:07.890
the interfaces that are annotated with this @Functionalinterface to

13
01:08.020 --> 01:15.120
make sure that the interfaces are not breaking the contract meaning it mandates the interface to have

14
01:15.120 --> 01:18.300
only one abstract method. Lets talk about 

15
01:18.300 --> 01:23.090
the new functional interfaces that got introduced as part of this Java8.

16
01:23.550 --> 01:31.070
The four primary interfaces are Consumer, Predicate, Function and Supplier. And each and every functional

17
01:31.140 --> 01:34.490
interfaces have their own extensions.

18
01:34.500 --> 01:37.870
Such as for consumers there is a BiConsumer, For Predicate

19
01:37.870 --> 01:46.460
there is a BiPredicate, For Function there is  BiFunction ,UnaryOperator and BinaryOperator.

20
01:46.590 --> 01:48.350
You might be wondering.

21
01:48.480 --> 01:55.410
I don't use any of these interfaces in my current project but still my application works like a charm.

22
01:56.320 --> 01:58.790
Why do I have to learn these interfaces right?

23
01:58.960 --> 02:05.650
The idea of this course is to give you the exposure to these new concepts and there are a lot of enhancements

24
02:05.680 --> 02:12.850
that are made to the collections such as a list, map, set that uses these interfaces which is going to

25
02:12.850 --> 02:15.790
make your development really really faster.

26
02:15.790 --> 02:21.310
Don't worry if this is too much information to take at the moment I'll be explaining you all the new

27
02:21.310 --> 02:26.250
interfaces by coding in the future tutorials. With this we came to the end of this tutorial.

28
02:26.350 --> 02:27.160
Thank you for watching.