In the previous two lectures, we've learned how to instantiate, or create, objects by using constructors. And we've also learned how to access state of an object through properties. In this lecture, we'll learn how to access behavior of an object. And you should start with an in video quiz to show me you remember the word we use to access behavior of an object. We can see from the documentation that the Deck class exposes four different methods. And we've already used the print method, so let's use the other three. And we'll start with the shuffle method. So here's the documentation for the shuffle method. First, we'll look at what data type the method returned. And we see, inside this magenta circle, we see that this method returns void. In other words, it doesn't return anything. And that makes sense because we're just shuffling a deck, we wouldn't expect the deck to give us anything back. It's just reordering the cards in the deck. The other thing we need to know before we can call this method, is that there's nothing between these parenthesis. And we'll get to the terminology for that for the next method. So for now, just like the deck constructor, this tells us that we don't have to provide any information when we call the shuffle method. So we're starting with the code that we ended with in the previous lecture. And we're going to add more code down here. So we'll say shuffle the deck. So just as when we called the print method here, we put the name of the object, deck., the name of method, Shuffle. And because we're calling the method not accessing a property, we need parenthesis. And because the documentation told us we don't need anything between those parenthesis, we don't provide anything there. Let's go ahead and print the deck after shuffling it o show that in fact it reorders the cards. And I'll Ctrl + F5, and you can see that these cards are no longer in the order they were in when we created the deck. So, the deck has been shuffled. The next method we want to look at is the cut method. And here's the documentation for the cut method. The first thing we notice is that it also returns void, so it doesn't return anything. Again, that's as we'd expect when you cut a deck. You're just sort of splitting the deck somewhere in the deck and putting the top half underneath the bottom half, though it may not be half. And so you don't get anything back, you're just, again, reordering the cards in the deck. The thing that is new for this one is that we now have parameters, well, we have one parameter. Specifically, we need to provide the location at which to cut the deck. And so this information about the parameter tells us that we need to provide an int. We don't care at all when we're calling the cut method that it happens to be called location inside the method. But we do care that we're supposed to provide an int, so we use that information. And now's a good time to talk about a little bit of terminology. When we're talking about information that gets passed into a method, from the method's perspective, those things are called parameters. That's what this word right here is, parameters. When we think of that information on the calling side, when we're calling the method, that information is called argument. Now, lots of times programmers will just say everything's a parameter and that's fine. You don't have to be a jerk, you can recognize what they're trying to say. But really from the method's perspective they're parameters, from the calling side they're arguments. So let's not shuffle the deck anyone so we can see the cut works properly. And in fact, we'll add a blank line here as well. So we can see where it's printing the deck after the cut. And if I Ctrl + F5, at the beginning we had clubs, diamonds, hearts, and spades. And after the cut, we have hearts, spades, clubs and diamonds. So there we go, the cut worked fine where we indicated that we wanted to cut in the middle of the deck. And finally, lets take a look at the TakeTopCard method. So here's the documentation for the TakeTopCard method. Different from the other methods we've been talking about, this method actually return something, this return type is not void. This actually returns a card object and so that's important as we call the method. And we see that it has no parameters. We don't have to tell it which card to give it to us, because we can't cheat. We can only take the top card. So I'll add a comment. And the way we call a method that returns something is we put it some where, so I'm going to put the return of card from the method call into a card variable and now I'll call deck.TakeTopCard. And by doing that, I can now print out information about the card. And I'll do that by accessing properties of the card. And I know that we have Rank as a property, And we have Suit as a property. And we'll add a blank line before doing this output as well. And as you can see, we get the King of Diamonds. The deck actually prints from the bottom to the top. So, the King of Diamonds was the top card and so that's what we got when we took top card. Now we do have the option when we call a method that returns a value to not put it into a variable. So let's do that. And that will take the top card from the deck and remove it from the deck but it just throws it on the floor, if you'd like to think that way. We no longer have a reference to that car so we certainly couldn't print its rank or its suit because we're not holding it in a variable anywhere. So if I run this again, you'll see that I took the top card and then I took the top card and saved it and that was the Queen of Diamonds. So although we're allowed to call a method that returns something and not see the thing it returns, we will usually find that we want to save it into a variable, so we can do something with it now that we have it. That's not always the case, but it is almost always the case. And that's it. We've now actually used all four methods including the print method, for the deck class. In this lecture, we learned how to access multiple behaviors of the deck object by calling the methods. And we used the documentation to figure out how to call those methods appropriately. And that means that now we've given objects their identity by instantiating them by calling a constructor. We've accessed state of objects by accessing their properties. And we've accessed behaviors of an object by accessing it's methods