1
00:00:00,360 --> 00:00:04,010
Will be polymorphism as the word goes.

2
00:00:04,020 --> 00:00:06,630
We have poly and Marth.

3
00:00:07,890 --> 00:00:13,200
So let's add the so we have poly in in many and we have more.

4
00:00:15,610 --> 00:00:25,960
Which means smooth change, polymorphism and pattern can be implemented using an interface, and the

5
00:00:25,960 --> 00:00:33,550
interface is some sort of method which can take many different forms which actually change depending

6
00:00:33,550 --> 00:00:34,270
on the input.

7
00:00:34,990 --> 00:00:42,520
So yeah, we could define this with the Founders interface, which permits us obtain the area of the

8
00:00:42,520 --> 00:00:43,750
given smiley.

9
00:00:44,140 --> 00:00:47,500
So we have area interface.

10
00:00:48,070 --> 00:00:55,450
It takes in the object and then it returns that object, the head area.

11
00:00:56,710 --> 00:00:57,640
There we go.

12
00:00:59,260 --> 00:01:00,760
Now we've defined as interface.

13
00:01:00,940 --> 00:01:02,920
Let's look at itself.

14
00:01:02,920 --> 00:01:06,190
Below we define let's define this tool.

15
00:01:06,220 --> 00:01:15,070
So firstly, we have happy and then we have some signs of type smiley and happy of type square smiley.

16
00:01:16,540 --> 00:01:23,050
So right, yeah, we could have area interface and then we pass in happy.

17
00:01:23,410 --> 00:01:26,620
So let's run this on that and there we go.

18
00:01:26,800 --> 00:01:28,540
We see that was iPad's in happy.

19
00:01:28,540 --> 00:01:29,590
We have its area.

20
00:01:30,040 --> 00:01:40,690
We could also pass in Happy and then modify this and say, okay, we want a side value of C 21 that

21
00:01:40,690 --> 00:01:50,110
we have not area we could pass inside and then pass in a radius of say, let's see, seven and then

22
00:01:50,110 --> 00:01:58,480
we have this area interface which takes different forms depending on what we pass in what kind of object

23
00:01:58,480 --> 00:01:59,170
we pass in.

24
00:01:59,440 --> 00:02:01,030
Yeah, we have set, we run that.

25
00:02:01,480 --> 00:02:03,090
Let's put in some prints here.

26
00:02:03,280 --> 00:02:04,300
You have prints.

27
00:02:05,650 --> 00:02:06,250
Prints.

28
00:02:09,750 --> 00:02:15,060
Then we go, let's put in one year as you give us the apple one for that gorgeous pie square.

29
00:02:15,420 --> 00:02:16,110
So that's fine.

30
00:02:16,410 --> 00:02:19,110
So we're going to have whatever value here and we have its area.

31
00:02:19,410 --> 00:02:29,190
So this interface now permits us to use the same piece of code to obtain the area for two different

32
00:02:29,190 --> 00:02:29,820
objects.

33
00:02:30,660 --> 00:02:36,900
And this helps us easily modify code and also maintain it.
