High this is ranked higher than welcome to the next video of this Cartland programming cities.
Now in this video we will learn about Varda do we mean by default functions in case of Cartland.
Now we learn this concept along with the concept of interoperability.
So make sure you have voiced my previous videos then only this video will make sense.
So first of all what do we mean by default arguments in case of functions.
Now suppose I have this Metford name find volume that takes a bit of land and breadth and height and
simply returns the value of the volume of an object.
Right now if you notice here here I have that third bit mean that as height equal to 10.
Now this is actually their default argument in case of Cartland.
So here even if you don't pass the value of height equal to something then also by default the HYGD
will have the value of 10.
So let us take some example.
So here from the main method if all find value method and simply pass the entry as a pyramid that is
Lendell become become.
But it will become three and hide which is by default then right.
So this will simply return.
That is the end of let's say 60.
So in the output we will have to do three into 10 equal to 60.
Right.
And now proceeding forward.
Suppose if I use this method find Vol. 2 3 and 20.
Now if you notice here we are also passing that told it to.
So here Lent will become two.
But it will become three.
And in case of height the value will be overridden.
And this then will now become 20.
So in the output we are going to get two into three into 20 equal to 120.
Right.
So by passing some value here we have simply overridden the void value that is present here.
Then right.
So here inside the intelligent ID this is the same application.
On top of which VVA of working in the previous videos as well.
So here inside the Cartland file I simply create a function.
So here this find volume method simply returns the volume of a particular object.
So inside the main method I would simply use variable reserved equally to find a volume and simply pass.
Let's see two three as Update media now and then simply put in the value of the result.
And now here if you notice here we have to compulsorily bars.
They're told we did no work.
If you don't have the value of the height to pause in their total it metre here.
Right.
So that is why we have their default functions in case of quarterly.
So here Bideford you can give it you can give this height some value let's see 10.
And now here the error will be rectified.
And by passing just two meters we can get the volume of the object right here just because we have their
default value of height as then and then simply then the called by simply clicking on this icon of this
one and simply and then simply run the called.
So here in the output we get 60 right.
And now here suppose if I pause let's say 30 now then we're passing the value of the height then this
value of the height will be older then and this then will be replaced by 30 because the compiler will
give more priority to this value.
And now again let us from the code.
So here we get it in the output.
So this is the advantage of using their default rate meters in case of Cartland.
And now what about the Giago file.
Can we call their default function from our Javal file.
The answer is yes and no boot.
Let's check it out.
Now Java doesn't support their default function if you are a Jaguar developer then you must be aware
of this.
We did not have any concept of default functions in case of Java.
So how can we call their default functions present inside the Cartland file from the job will fail.
So far that we have the A.P. ition of Adoree JVM overlord's.
So this will simply give rise to the interoperability of the java and the Koechlin files.
So inside the indelicacy 80 samples from the java file.
If I tried to call the find value method by simply using this last name my custom girdling filename
my custom girdling finally Dorte find volume and simply buzz.
Let's see food and let's say seven as up if we could so it will simply show some added because the required
argument is three.
And we are only passing the two arguments right.
Just because in Java we don't have any concept of their default function.
So what we can do here is insert my first not guilty.
We can simply use the notation right above defined volume method by using the enervation of our direct
JVM overlords.
Right.
So this will simply make this function compatible with my java file.
Now here the error has gone.
So now you can simply pass to beat meters and simply get that is added.
So I would simply use an that is equal to this one.
And now down the side I will simply print out the value of what is inside our Jabo failed and now to
run the code.
You can simply click on here and then simply then my job will find or mean.
So in the outward record the volume of the object as to it by simply passing two prime readers.
And of course you can pass Treebeard meters as but you will wish.
Let's see what the height is for the bread.
And lent is 7 and 4 respectively.
And now again I read the code by clicking on this icon here.
So here we get some other output of 1 1 2 0.
As it is.
So this was all about their default functions.
And in this video itself.
We also saw how can we call their default function from a particular java file by using the annotation
of our direct JVM overlords.
So see you guys in the next video.
Thanks for watching.
This is considered signing off.