 Hey everybody this is Brian and if you've been following along this is video 17 in our visual basic tutorial today we're going to be talking about the stack. Stack is a, well it's a stack, think of it like a stack of papers. And stack equal new, we'll say stack. So a stack is a last in first out like a stack of papers. You have a pile of papers on your desk, you put a piece of paper on top of it, it'll be the first one you take off. So it's last in first out. Now this is very similar to what you've seen so far but instead of NQ or DQ or add you use what's called peak, pop, and push. Peek, I apologize I should have also added that into the Q class. Peek simply lets you peek and see what's there without actually manipulating the list at all. Pop removes and returns the item and push pushes a new piece of paper onto the stack. So let's actually do papers.push and we'll say we've got our resume and let's say what else do we want to put in here? We want to put our, oh yes our handy TPS report and we will say our handy to-do list. That's our stack of papers right there. Now if you're wondering what a TPS report is go see the movie office space, it's pretty funny. So let's say console.rightline and let's say we want to peek. Now remember a peek will just tell us what's at the top of the stack without actually removing it. So when you run this, well it says to-do list. Why does that? To-do list is at the bottom. Remember you're adding to it. So resume would be at the bottom because it was the first one. TPS report would be in the middle. To-do list would be on top. So when you're grabbing something off that list, you're going to grab the last one in which was the to-do list. To prove that we're going to pop that. Why it's called pop? Well it has its roots back in the old days of C++ which is a more complex language than what you're working with. But this is a very convenient class. So you can see that when we pop it we get the to-do list and let's pop it a couple of times. Yes I hear you snickering in the background. Stop that. Alright after we've popped it a couple of times I gotta stop and make myself snicker. You can see we grab the to-do list and we grab the TPS report. Now what happens if we grab more items than what we have? Well you can see stack empty meaning you don't have any papers left in your stack. You can always check the count. You see we are popping the three items and we're getting the count which means that is out of paper. You can always reference the count to determine how many items are in your stack or your queue or your list or whatever you're working with. This is Brian. I hope you found this tutorial educational and entertaining. As always drop me an email, subscribe to my channel. If you have any questions, comments just let me know. Thanks.