 Hey everybody, it's Brian. Welcome to the third C-Sharp tutorial. Today we're going to be discussing variables. Go to Google and type C-Sharp variable types. In the second link you'll see built-in types table. This is actually an MSDM, which is part of Microsoft. And you'll see we've got this big table of different variable types. Well, let's back up. What's a variable? A variable, if you remember from your science class, is something that will change. It varies. That's why it's called a variable. We have different types of variables. For example, bull, short for boolean, is simply an on-off. It's like a light switch. Think of it as, you know, you turn it on, you turn it off. You're either hungry or you're not. And then we have things like care. Short for character. Well, character could be like the letter A or the tab key. And then you have like decimal. That's a number. Could be like 1.0 or 300.586. And then you have float, which are floating points, if you know that from your math class. And look here, object. Remember from our last tutorial I said everything in .NET is an object. So sure enough you have an object type and everything inherits from that. And then you have like string. String is like a sentence. For example, this right here, that's a string. So let's jump right on in and let's just make a real simple program. I'm going to make a new console application. And first we need to declare a variable. So we're going to say string because we're going to get a sentence and we'll call it person equals nothing. And the quote unquote just simply means nothing. And we'll say console dot right line. Please enter your name. Console dot read line. And what I want you to look at here is where it says reads the next line of characters from the standard input stream. See right there where it says that. What does that mean? Well the input stream is what the user is typing. So we want to grab what the user types. We're going to say person equal console dot read line. So whatever the user enters and as soon as they hit the enter key, it's going to get shoved in this person variable. Now remember this is a string and it says represents text as a series of unicode characters. Don't get hung up on some of the terminology if you don't know what unicode is. Basically just think of it as a lot of characters. It's the sentence. And now we're going to say console dot right line. Whoops, there we go. I'm sure to add that semicolon at the end. We'll say nice to meet you. Space and then the variable. Now notice how the variable is not inside the quotes here. This is a string. And what we're saying is console right line this string plus this variable. And it knows that person is a local variable of these string types as string person. It's always type then the name. Then you assign. See that equal sign? That's the assignment operator. You're assigning a value. You always want to assign an initial value to your variables that way you don't crash your program. Something that we'll probably cover in future tutorials, but in short if you try to use a variable and it's not assigned to your program will crash. It's always a good idea to say equals and then just give it a default value. Then we just want to say console dot read line. That way our console stays open. Go ahead and run this. It says please enter your name. My name's Brian. It says nice to meet you Brian. Press the enter key again and it disappears. And let's run it one more time. It says please enter your name. My daughter's name is Heather. So I know that. It says nice to meet you Heather. What you're witnessing is called a polymorphic algorithm. Meaning the state of the application changes even though the code did not change. You see how you have two different outputs on the screen. One said Brian, one said Heather based on what you entered into the program. It's called a variable. Something that will change. That's really it for this tutorial. I know it's kind of a short simple one and if this is not your first time going over variables you're probably just rolling your eyes going really. That was it. Well yeah that was. I'm trying to keep this fairly simple and easy so that if you're just beginning you can follow along. But at the same time it's not a 20 minute video so if you already know this you don't waste 20 minutes of your life. Anyways this is Brian. Thanks for watching. I hope you found this video educational and entertaining. And you will be able to find the source code for this out on my website voidrealms.com. You can find that on my YouTube channel.