Not look at a feature that was introduced in Jollof by Karl Marx before Jolliffe I meant it could only 2
be invoked with fixed number of arguments. 3
That is you may have a method that has three parameters and so you can look at that exactly the arguments 4
. 5
But that needn't be the case from giallo 5 onwards from Delphi onwards. 6
Methods can have a special type of parameter called quarks which is shorthand for variable length arguments 7
and as the name suggests this parameter can become variable number of arguments. 8
There is even though it's a single parameter it can take either 0 or 1 or even more than one argument 9
as in. 10
Also it's got to be the last parameter of the method. 11
It can also be the only parameter of the method. 12
So it could be the only parameter of a method or if the matter has more than one parameter then the 13
broader experimenter must be the last one. 14
Now let's look at the syntax of a broad experimenter and also have the invocation looks like syntax 15
in most three dots are ellipses. 16
Following the parameter type and here is an example as you can see the parameter type and is followed 17
by three dots. 18
Now when it comes to any location the corresponding argument can be an array of any size or it can also 19
be a sequence off any number of comma separated arguments. 20
As you can see the values run butare are simply being passed as comma separated values in this because 21
the compiler automatically can merge them into an array. 22
So basically the arguments are getting passed as an array whether you do it explicitly or not. 23
This also means that the blot on experimentor in the method definition is also an order. 24
So when we compile the compiler automatically converts of what I've spent ometer into an array. 25
So that in the method the watch parameter is treated as any normality. 26
Finally the last argument could be omitted altogether. 27
So in one example the method for is invoked with only the boolean argument internally and MPO it will 28
be passed without blocks barometer. 29
So basically the number of parameters has been fixed. 30
It's just that the parts parameter gives the flexibility in passing either 0 or more argument values 31
. 32
It just gives an illusion that the method is infinitely overloaded. 33
Dumps of restrictions. 34
I just want to reiterate that the water experimentor must be the last barometer when the method has 35
more than one parameter and the restriction is that a metric cannot how more than one product barometer 36
. 37
OK. 38
Next is the question itself why products can't we simply use an array as parameter which can also take 39
really the moral values. 40
Of course we can do that. 41
But the main advantage of products is that it provides us with more simpler unflexible in rockish mechanism 42
. 43
That is if you don't how many values to pass. 44
You can simply pass a mask coalmines operator values and if there is nothing to pass you simply need 45
not pass anything at all. 46
That is you don't have to pass null on an empty at it the compiler automatically passes an empty threat 47
. 48
So that's just a cleaner syntax on it because if you have a large number of values to pass you can simply 49
gather them into an array and pass it to them. 50
So that's a main advantage of blocks. 51
It gives us a more simpler and flexible invocation mechanism. 52
There's a method called Print def which was introduced in Jollof I understood a very nice example of 53
using Bartok's. 54
It's basically used to print formatted text and disseminate the print L.N. and then statements that 55
we already know. 56
First parameter is the text to be appended while the second isn't what x parameter type of the second 57
parameter here is object which is a class in Java and we can look at it later. 58
Let's look at this example in location. 59
That's printing data but here the first argument is the text to be printed. 60
Well second third and fourth arguments correspond to the warhawks parameter. 61
You can also see three person dead symbols in the first argument. 62
Basically at runtime the printf method would replace the three person dead symbols with a three argument 63
values 1 1 and 1978 that are pastor's input to the experimenter. 64
So basically person does ambos so s placeholders here. 65
So that's one good example from the Java library itself. 66
Next we know that this is a definition of Main method. 67
No it blocks it's perfectly valid to replace the input array parameter of what water barometer. 68
Next there are certain rules that we need to be at off when it comes to using broad method as an overloaded 69
method. 70
Let's look at the first rule using an example. 71
Let's see if we have this what method call foo. 72
Then we cannot have an overloaded non-God method that looks like this. 73
So it would be an invalid order as you can see the signature is exactly identical Savatage. 74
Barometer is simply an array to. 75
Next if you have a bunch of overloaded methods and if one of them is a wad oximeter then doing method 76
invocation the blocks method will be the last one to be matched. 77
Let's actually look at a simpler time off. 78
This second rule variegata method will be the last one to be matched Spoonman. 79
That's how I've been added to the basics class. 80
And since there are overloaded methods both of them have the same name and they have been named S-box 81
since it's a lot Arc's demo and since it's overloading them also. 82
So when it blocks or whatever. 83
OK so these are the two methods. 84
Let's look at the input parameters here. 85
So this this one does not have an ox parameter so it has a boolean parameter on three regular parameters 86
. 87
Second one is a warhawks method. 88
The second method has what x parameter so it has a boolean parameter. 89
And here is the what x parameter. 90
OK and here we are printing in the first metor we are saying inside quarks or not. 91
But without what on X and the second we are saying insert Warlock's or not. 92
But with what ARX. 93
OK and we're also printing the length of the input parameter. 94
Ok since this is an array we are printing done lento. 95
OK now let's look at the invocation statements here. 96
So we have three invoke mission statements. 97
OK one of them is passing through and the ralliers one to 3 and the second one is passing through on 98
one to 8 values here and the fourth one is just passing on the boolean argument. 99
OK and so in the first case it were frustrated as we discussed earlier that it would first try to find 100
an exact match in this because there is an exact match. 101
One boolean on the 2:59 bluesman fit here. 102
So in this case the first order of the method gets invoked in the second and the third case. 103
Since there is no exact match the the second overloaded method will be picked which is a white box which 104
is a warhawks method. 105
OK hon will the length of the array in this case it would be 8 iron in the second case in that in the 106
last example it would be zero. 107
OK so let's just go ahead and compile and execute this. 108
So I'm in the basics directory. 109
OK so as you can see here with the first invocation it is inserted but ours a lot but without what varargs 110
. 111
So that's the first method and for the second invocation where you are passing 8 ralliers comma separated 112
values. 113
So it is in sidewards overload. 114
Read watch on it bench the lines of the array which is on the final one where you are passing just a 115
boolean at Bernd's zero as the last. 116
OK so that's about it. 117
So that's the autoloading feature retrospect do what oximeter. 118
OK so just go ahead and play with it. 119
You can also pass arrays here instead of just call my separated values. 120
So just go ahead and play with it and you can also find the updated program and the resources section 121
. 122
All right then. 123
Thank you.