 So now we've shown that we can make programs and we can actually even do math with the computer But we ran into a problem what we were using Before when we were saying hello world in nine plus two nine times two was we were using what are known as literals now a literal is just data that we use and then It's gone forever. It's it's thrown away. It's moved on You know it was used just for that moment and that's it But what happens if I want to Save my values. Well, what I do is I actually create something known as a variable now a variable What is a variable basically if we think about that basic machine architecture again? We're dealing with the memory stick and inside here all these little blocks all they do is store Information all they do is store ones and zeros now. How do I get those ones and zeros to mean something? If you remember we talked about ASCII just for a hair and that's how we use binary to represent strings are represent letters on the computer We do the exact same thing with Everything and that's where we get into this idea of what's known as a data type So let's say for example. I want to store the number 13 13 gets converted down into ones and zeros. They can actually get stored in a bit but Generally speaking what we do is we store things as what's known as an integer an int if you will that first number On the screen now what we do with that is all we do is we come in and we create a Simple program Let's take a look at what we had before the 9 plus 2 I'm gonna scrap that. I'm just gonna get rid of it Now what we say is we start By identifying what the data type is so I said I want to make an integer And I said I wanted to be 13 characters long or 13 the number 13 Now before I do anything before I try and start to go 13 I have to do what's known as create my variable. This is actually known as declaration or initialization and what I'm doing is I'm giving my Variable a name so far my case. I'm gonna say my Number I'm gonna call this integer my number Now what I do is I include now The equal sign the equal sign in programming is classified as the Assignment operator the assignment operator is just that think about Kindergarten for a second How do you know that the equal sign is the equal sign? You were taught that way back in the day in kindergarten This meant that it meant equal and that something on the left side was equal to something on The right side That's how we make a declaration if I need to make any type of Value and I want to store that for later use I create a variable I give it a name and I put the value on the right side Now that's something that actually throw out there as well. I'm doing something known as Left to right Association what do I mean by that well left side? The left side of this equation has to be The memory address it's the where if we look at this guy again this memory stick I am telling it how much space to store Again, if you look we're talking about that 32 bits. We are dealing with I'm storing 32 bits Somewhere in here and then on the right side the right side of the left-to-right association I'm giving it what I like to call the what the evaluation the expression So again the way I like to look at it the left side That's my where the right side That's my what and this gets evaluated otherwise other ways as well Say for example again. I said I want to use my number for later use So what I can do is I can say another integer. I can create another integer and I'm going to call this my other number Now again, I've created it on the left side. I've said I'm going to make another location in memory and I'm going to set it equal to my number times two Times two times two what that allows for me to do now is I can take what's in my number again The right side of this equation is the what side and it evaluates it So my number being 13 gets evaluated as 13 times two 13 times two 26 I'll even put a comment in there. So you don't have to Keep an eye on that. That's a good reason to put a comment in Now let's actually take a look at this. I'm going to do a system dot out that print line real quickly system dot out that print line l n My other number remember you can hit tab And it will auto complete it for you And you don't have to worry about that. So let me save that and let me pull up my command line because once again I do need to compile this early compile this often. I've made a change So suddenly Java C welcome dot Java It compiled fine. That's what I like to see Java welcome as soon as I hit enter. I should see 26. Good. That's exactly what I wanted But I want to make a change Now I said that the equal sign the equal sign was known as my assignment operator Well that assignment operator here's where programming differs a little bit from traditional math I'm actually able to change this number. I'm actually able to go and say my number equals my number Plus one what am I doing here? Again left to right Association kicks in left to right association dictates that the left side of my equation is the where side Again, it's the where in memory. Are you? Now what I'm doing is I'm dealing with the right side the right side of the equation is the What side of the equation? It's dealing with what it gets evaluated out to so right now my number is equal to 13 so what I'm saying is at the memory address At the memory address of my number Make it equal to whatever's currently in my number plus one and then let's say for example I print that out as well system dot out dot print L in my number When I compile this and I run it what I should see is 2614 because 13 has just been Incremented by one