1 00:00:01,420 --> 00:00:06,370 High this is ranked higher than welcome to the next video of this Cartland programming cities. 2 00:00:06,400 --> 00:00:12,300 Now in this video we will learn about Varda do we mean by default functions in case of Cartland. 3 00:00:12,310 --> 00:00:16,930 Now we learn this concept along with the concept of interoperability. 4 00:00:16,960 --> 00:00:23,020 So make sure you have voiced my previous videos then only this video will make sense. 5 00:00:23,020 --> 00:00:27,640 So first of all what do we mean by default arguments in case of functions. 6 00:00:27,640 --> 00:00:33,790 Now suppose I have this Metford name find volume that takes a bit of land and breadth and height and 7 00:00:33,790 --> 00:00:38,020 simply returns the value of the volume of an object. 8 00:00:38,050 --> 00:00:44,630 Right now if you notice here here I have that third bit mean that as height equal to 10. 9 00:00:44,680 --> 00:00:48,650 Now this is actually their default argument in case of Cartland. 10 00:00:48,790 --> 00:00:54,640 So here even if you don't pass the value of height equal to something then also by default the HYGD 11 00:00:54,640 --> 00:00:56,580 will have the value of 10. 12 00:00:57,070 --> 00:00:58,660 So let us take some example. 13 00:00:58,800 --> 00:01:05,890 So here from the main method if all find value method and simply pass the entry as a pyramid that is 14 00:01:06,170 --> 00:01:07,300 Lendell become become. 15 00:01:07,490 --> 00:01:11,560 But it will become three and hide which is by default then right. 16 00:01:11,590 --> 00:01:13,260 So this will simply return. 17 00:01:13,320 --> 00:01:16,140 That is the end of let's say 60. 18 00:01:16,150 --> 00:01:20,710 So in the output we will have to do three into 10 equal to 60. 19 00:01:20,760 --> 00:01:21,610 Right. 20 00:01:22,000 --> 00:01:23,710 And now proceeding forward. 21 00:01:23,740 --> 00:01:29,170 Suppose if I use this method find Vol. 2 3 and 20. 22 00:01:29,170 --> 00:01:32,910 Now if you notice here we are also passing that told it to. 23 00:01:33,220 --> 00:01:35,660 So here Lent will become two. 24 00:01:35,770 --> 00:01:37,190 But it will become three. 25 00:01:37,330 --> 00:01:40,860 And in case of height the value will be overridden. 26 00:01:41,050 --> 00:01:43,650 And this then will now become 20. 27 00:01:43,810 --> 00:01:49,660 So in the output we are going to get two into three into 20 equal to 120. 28 00:01:49,660 --> 00:01:50,470 Right. 29 00:01:50,500 --> 00:01:57,110 So by passing some value here we have simply overridden the void value that is present here. 30 00:01:57,160 --> 00:01:59,270 Then right. 31 00:01:59,380 --> 00:02:03,340 So here inside the intelligent ID this is the same application. 32 00:02:03,370 --> 00:02:07,750 On top of which VVA of working in the previous videos as well. 33 00:02:07,750 --> 00:02:11,320 So here inside the Cartland file I simply create a function. 34 00:02:11,620 --> 00:02:16,620 So here this find volume method simply returns the volume of a particular object. 35 00:02:16,630 --> 00:02:23,170 So inside the main method I would simply use variable reserved equally to find a volume and simply pass. 36 00:02:23,200 --> 00:02:31,600 Let's see two three as Update media now and then simply put in the value of the result. 37 00:02:31,750 --> 00:02:35,470 And now here if you notice here we have to compulsorily bars. 38 00:02:35,510 --> 00:02:37,490 They're told we did no work. 39 00:02:37,500 --> 00:02:42,460 If you don't have the value of the height to pause in their total it metre here. 40 00:02:42,550 --> 00:02:43,060 Right. 41 00:02:43,210 --> 00:02:46,860 So that is why we have their default functions in case of quarterly. 42 00:02:46,990 --> 00:02:53,450 So here Bideford you can give it you can give this height some value let's see 10. 43 00:02:53,590 --> 00:02:56,140 And now here the error will be rectified. 44 00:02:56,590 --> 00:03:03,310 And by passing just two meters we can get the volume of the object right here just because we have their 45 00:03:03,310 --> 00:03:10,030 default value of height as then and then simply then the called by simply clicking on this icon of this 46 00:03:10,030 --> 00:03:13,920 one and simply and then simply run the called. 47 00:03:13,940 --> 00:03:17,220 So here in the output we get 60 right. 48 00:03:17,470 --> 00:03:24,590 And now here suppose if I pause let's say 30 now then we're passing the value of the height then this 49 00:03:24,680 --> 00:03:31,790 value of the height will be older then and this then will be replaced by 30 because the compiler will 50 00:03:31,790 --> 00:03:34,370 give more priority to this value. 51 00:03:34,550 --> 00:03:36,950 And now again let us from the code. 52 00:03:37,310 --> 00:03:40,190 So here we get it in the output. 53 00:03:40,190 --> 00:03:45,650 So this is the advantage of using their default rate meters in case of Cartland. 54 00:03:45,730 --> 00:03:47,860 And now what about the Giago file. 55 00:03:47,980 --> 00:03:51,460 Can we call their default function from our Javal file. 56 00:03:51,460 --> 00:03:53,820 The answer is yes and no boot. 57 00:03:53,980 --> 00:03:55,590 Let's check it out. 58 00:03:55,610 --> 00:04:01,570 Now Java doesn't support their default function if you are a Jaguar developer then you must be aware 59 00:04:01,570 --> 00:04:02,280 of this. 60 00:04:02,290 --> 00:04:06,140 We did not have any concept of default functions in case of Java. 61 00:04:06,370 --> 00:04:12,290 So how can we call their default functions present inside the Cartland file from the job will fail. 62 00:04:12,430 --> 00:04:18,680 So far that we have the A.P. ition of Adoree JVM overlord's. 63 00:04:18,780 --> 00:04:24,450 So this will simply give rise to the interoperability of the java and the Koechlin files. 64 00:04:24,480 --> 00:04:28,230 So inside the indelicacy 80 samples from the java file. 65 00:04:28,350 --> 00:04:35,070 If I tried to call the find value method by simply using this last name my custom girdling filename 66 00:04:36,470 --> 00:04:41,190 my custom girdling finally Dorte find volume and simply buzz. 67 00:04:41,210 --> 00:04:48,430 Let's see food and let's say seven as up if we could so it will simply show some added because the required 68 00:04:48,440 --> 00:04:49,780 argument is three. 69 00:04:49,820 --> 00:04:53,100 And we are only passing the two arguments right. 70 00:04:53,500 --> 00:04:58,280 Just because in Java we don't have any concept of their default function. 71 00:04:58,670 --> 00:05:02,700 So what we can do here is insert my first not guilty. 72 00:05:02,710 --> 00:05:08,720 We can simply use the notation right above defined volume method by using the enervation of our direct 73 00:05:09,200 --> 00:05:11,560 JVM overlords. 74 00:05:11,600 --> 00:05:12,390 Right. 75 00:05:12,590 --> 00:05:17,010 So this will simply make this function compatible with my java file. 76 00:05:17,210 --> 00:05:19,020 Now here the error has gone. 77 00:05:19,130 --> 00:05:23,650 So now you can simply pass to beat meters and simply get that is added. 78 00:05:23,750 --> 00:05:29,070 So I would simply use an that is equal to this one. 79 00:05:29,200 --> 00:05:37,270 And now down the side I will simply print out the value of what is inside our Jabo failed and now to 80 00:05:37,270 --> 00:05:38,120 run the code. 81 00:05:38,170 --> 00:05:47,550 You can simply click on here and then simply then my job will find or mean. 82 00:05:47,740 --> 00:05:53,830 So in the outward record the volume of the object as to it by simply passing two prime readers. 83 00:05:54,050 --> 00:05:57,570 And of course you can pass Treebeard meters as but you will wish. 84 00:05:57,570 --> 00:06:00,730 Let's see what the height is for the bread. 85 00:06:00,770 --> 00:06:03,660 And lent is 7 and 4 respectively. 86 00:06:03,950 --> 00:06:07,520 And now again I read the code by clicking on this icon here. 87 00:06:10,250 --> 00:06:13,690 So here we get some other output of 1 1 2 0. 88 00:06:13,730 --> 00:06:14,760 As it is. 89 00:06:15,050 --> 00:06:17,320 So this was all about their default functions. 90 00:06:17,360 --> 00:06:18,800 And in this video itself. 91 00:06:18,890 --> 00:06:26,450 We also saw how can we call their default function from a particular java file by using the annotation 92 00:06:26,480 --> 00:06:28,980 of our direct JVM overlords. 93 00:06:29,240 --> 00:06:31,010 So see you guys in the next video. 94 00:06:31,010 --> 00:06:31,950 Thanks for watching. 95 00:06:31,970 --> 00:06:33,680 This is considered signing off.