Welcome back in this video before we go over void and the return types, I think we should look at parameters
first.
So I said that there are these things called parameters that we can add whenever we want to define a
method okay.
So I'm going to get rid of my first method.
And calling the first method I'm going to get rid of all of that.
And I'm going to create a new method.
So void.
And I'm going to call this one right something okay.
And what this will do is it will just write something onto the console that will just say I'm writing
something.
Okay, super boring method.
But let's call this method right.
Something like so this is how we define the method and this is how we're declare.
This is defining and declaring the method.
And this here is how we call the method.
Right.
We've seen that before.
But how about I want to write something very specific.
So then we can create a new method.
Right.
Something specific.
And now if I want to write something specific I need to pass data to it.
So how can I pass data in here by defining it in the declaration of the method.
So here I can just say string my string.
So here a method that has the parameter my string of type string.
Now you could call this whatever you want.
However, it's important that if you want to use it inside of those brackets, you need to use that
same name.
So I can just say whatever you pass to me, I'm going to write that.
So I'm going to use c w again Console.WriteLine.
With a tab.
And I'm going to say my string is and I'm going to write my string.
Or I could just say something like you passed this argument to me.
And then we're going to say my string.
So what is this argument?
Now the thing is, there is this one thing that is called parameter.
So this here is the parameter.
And whenever we call the method so let's say write something specific here.
We're now passing the argument.
You can see that here where it says there is no argument given that corresponds to the required parameter.
My string of right something specific.
So here I need to pass something that is of type string.
So let's say I say something stupid okay.
So I'm going to just add stupid in here.
So what this will do is this will now call this method here.
We'll give it the value of stupid as my string.
And then it will execute that with my string.
So let me run this.
And you can see here I'm writing something.
That's our other method.
This is this one here, the one without a parameter.
And then when we scroll down we see it says right.
Something specific.
It gets the string that we pass as stupid.
And then it just says you pass this argument to me stupid.
Okay.
Very good stuff.
So now instead of just using this parameter that I passed directly as a string, I could also pass a
string variable in here.
So I could just have a string variable that just is my username.
So my username for example.
And I could just call this one Frank.
And then I just can pass the username in here.
So pass my username in here.
So instead of stupid I'm just going to say you pass this argument to me Frank okay.
So Frank was passed as the argument.
So once again what is the parameter and what is the argument.
So this here is the parameter.
So it's the thing that is inside of the parentheses inside of the brackets of the method when you define
the method.
So here we are defining the method.
This is the method declaration.
So method declaration.
And here this is when we are calling the method.
So calling the method and we are using a argument or an argument using an argument called my username
okay.
So here it's the parameter when defining or declaring the variable.
And here it's called argument.
Now sometimes I use them interchangeably.
It is really not that important.
The general idea is just that you know that there are these two different words.
And in order to be very specific, it's useful.
But otherwise even if you call this one parameter, it won't be a big problem.
However, if you want to be very specific, you need to know that this is the argument.
And here it's the parameter.
Okay, now this is a very basic example.
In the next video we're going to look at a more valuable example.
Because this is really just about showing you the general concept.
In the next video, we're going to look at how we can get numbers and add them together or divide them
for example.
Okay.
So see you in the next video.