In this lecture, we'll explore method headers in more detail. Specifically, we'll see how to implement method headers for four different kinds of methods and we'll also see how to call those four different kinds of methods. Before we do that, let's talk about what a method header tells us. A method header tells us who can call the method, it tells us whether the method is called on an object or a class, it tells us what data type the method returns, it gives us the method name, and finally, it tells us what information we pass into the method when we call the method. Here's an explanation of the syntax for a method header. So, this first piece called the [access modifier] tells us who can call the method. So, if we make this method public, then anyone can call it, and if we make it private, then only other methods within this object can call it. And the square brackets mean that the access modifier is optional, and if we don't provide it, the default is private. The next piece of the method header tells whether we call the method on an object or on a class. And if we do not provide the keyword [static], then we call the method on an object. But if we do include that [static] keyword, then it's on a class, not an object. And we've seen static methods before. So, the console writeline method is a static method because we call it on the console class, not on an instance of that class, not on an object. This tells us what dataType that your method returns, then we provide the method name. And finally, we have a list of zero or more parameters, pieces of information that get passed into the method. And for each parameter that we do include, we include the dataType for that parameter and a parameterName. The way that we will refer to that parameter within the body of the method. Given that, you should go do an in-video quiz about what we've discussed so far. As I mentioned at the beginning of this lecture, there are four kinds of methods. There is a method that doesn't return anything and doesn't require any parameters, there is a method that doesn't return anything and does require parameters. there is a method that returns something but doesn't require parameters, and finally, we have a method that returns something and requires one or more parameters. Let's make this a little more concrete by going to some code that implements and calls these four kinds of methods. We're going to look at the four different kind of methods we talked about in our deck class. So, the first kind we'll look at is a method with no return value and no parameters. And that's the shuffle method in our deck class. We indicate no return value by putting void as the returnType for our method, and we indicate that there are no parameters for this method by putting nothing between the open and close parentheses in the method header. So, when we call the method, all we do is put the object's name and dot and then the method name and then nothing between the parenthesis. And that's how we call the method with no return value and no parameters. And this is what the method header looks like for that kind of method. The second kind of method we'll look at is a method with a return value and no parameters, and that is the TakeTopCard method in our deck class. It returns a card. So, this is not void. This is something other than void. So we're actually returning something from this method, but it still has no parameters because we don't have anything between the parentheses. The typical way that we call the method that returns something is that we call the method as we're used to calling methods over here on the right, and then we put it into an object or a variable of some sort to hold the value that gets returned. You don't have to do this. You could in fact just call deck.TakeTopCard and it would return a card, and if you don't put it in a variable, you're sort of throwing it on the floor because you don't need it but usually we need whatever gets returned from the method. So, this is the typical way to call a method with a return value and no parameters. And this is what an example method header looks like for a method that returns a value. This return type is not void, but there's still nothing between the open and close parentheses in the method header. The third type of method we'll talk about is a method with no return value but it does have one or more parameters. And that's the cut method in our class. No return value. So, it's void, but we do have our parameter here. So, when somebody calls the cut method, we expect that somebody to provide an integer for the location. It's certainly impossible to have multiple parameters. We could say, float mass, or something like that as well. I know this makes no sense at all in this particular example, but if we have multiple parameters, we just separate them with a comma here in the method header, and when we call the method, we separate our arguments with a comma. This one, of course, only has one parameter, the location at which we should cut the deck. So, calling this kind of method, we put the object and dot and method name, and finally, between the parentheses, we put some value. And I who said here that I want to cut exactly in the middle of the deck, but certainly we could say seven here, instead, if we wanted to cut at location 7, we could even have a variable called location that we set to that deck.count/2, and then put location here. So, the bottom line is, whatever we put between these parentheses needs to evaluate to an integer. So, I'm going to put it back the way it was. So, this is how we call a method that doesn't return anything but has one or more parameters and this is what our example method looks like. Doesn't return anything because it has void, but it does have parameter information between the parentheses. And by the way, this should look very much like a variable declaration to you, where we put a dataType and then a name because in some ways, we're actually declaring this parameter as a variable that we can use within the body of the method. So, that's why it looks like a variable declaration because this isn't precisely true, but it's close enough for the way we can think about the way it works. Our final kind of method is a method with a return value and with parameters. And that is the TakeCard method in our deck class. And this is really only useful for magic tricks. Pick a card, any card. You really aren't usually allowed to just grab a card from a particular location in a deck. Usually we're dealing from the top of the deck. But for the sake of this example, I've added the TakeCard method that returns something. So, this isn't void. It says it returns a card and has a parameter. What's the location of the card that you want to take from the deck. So, we call the method by putting the object name dot method name and whatever we want our location to be between the parentheses as an argument that we're passing into the method. And then when that method returns a card, I'm putting it into a card object because I know I want to use that card object to do other things. So, the example of calling a method with a return value and parameters is here. And here's what our example of method header looks like, with a return value that is not void and a parameter that we expect whoever calls this method to provide. To recap, in this lecture, we learn what information a method header provides for us, we learned how to implement the four different kinds of methods, and we learned how to call those four different ki-.