 It's CryptoGround here. Welcome back to another C-Shop Crash Course video. This is episode four and today we're going to be introducing ourselves to variables. If you enjoyed this video, make sure you smash that like button, subscribe to my channel if you're new, and turn on those notifications. If you want to support me, check the Patreon, it's in the description, check out my other videos in the top right corner and comment all of your feedback, compliments and suggestions in the comments below. Anyways, let's hop into it. So in this video we're going to be introducing all the variable types. Okay so I have set up our variable class here and basically how this works is we have a variable's class with all the different types of variables, this one being just an example since Distract is a thing in here in our namespace, state namespace, and we have a public static void main method and when we hit play, basically it's going to tell us the max value between all of them, okay? So let's explain all of them. So first, let's start with variable formatting. So first we have the access modifier, which I'll have a video on that, the variable type and the variable name, okay? So the variable name must be different for all variables, okay? Now each class can also have the same name, so you see how I have AS byte, right? So if we make another variable, let's say an int and it will be called AS byte, it's going to give us an error, oops, this is lowercase, because this already exists, right? However, if we make another class and put it in here, then we can use this AS byte variable in another class like this, right? Okay, so let's delete that and let's explain all of them. So first the numeric variables. So we have assigned and unsigned variables, okay? So what's it? Here, wait, these are not assigned, okay? So what's the difference between assigned and an unsigned variable? Well, basically a signed variable gives us an extra byte, it sacrifices one of its bytes or one of its bits to allow it to be negative, okay? Because basically one of these bytes or bits, sorry, determines if it's positive or negative. So if it's zero, it's positive, if it's, I think it's zero, it's positive, and if it's negative, it's one, it's one or the other, but it doesn't really matter what it is. Just know that one of the bits for these variables are used for determining if it's positive or negative. Now unsigned basically is, so these are always positive, right? Because we don't have that bit to determine if it's positive or negative. Instead, it allows us to store extra, okay? Basically twice the amounts because we have that extra bit. So these are really good. If you know for a fact, these are always going to be positive, right? So if these are going to be negative, then you want to use short assigned variable, okay? And you'll see this here. You'll see it in here. You'll see how the assigned variables here are going to be much bigger than the unsigned, okay? No, sorry. It's other way around. These ones are going to be smaller and these ones are going to be bigger, okay? So now these ones here are called floating point variables. So what is a floating point variable? Basically all of these decimals can have decimals or these variables can have decimals in them, okay? So float is the smallest out of all of them. No, actually decimals are smallest out of all of them. Float is the second and double is the biggest. However, decimals the most precise. So basically it has more decimals of precision compared to these two. And float has more decimals of precision compared to double. So if you're looking for very massive numbers like an idle game or just huge numbers in general, you should use a double. So decimals are good for exact measurements and floats is called a floating point number, okay? So that's the floating point variables and we have our Boolean variable which is just a bool. So it's either true or false. It's just a one bit variable and we have a string variable. These are treated more as if an object, but you can set strings to whatever as long as you do it properly. So you can set it as like, hello, CG here was here, something like this. This is called a string, a string of characters, okay? We also have another one and I've got to add it's called char. So basically this is a single character variable. While string is a, it contains however many chars you want, okay? So you set it like this. So this is not going to work, okay? Now char uses a very specific, it uses these instead, okay? So this is a char and this is a string. So string is a combined, a combination of a bunch of chars, okay? And district as I explained before is our object that we made in namespace blueprints, okay? So all of these have the same variable formatting rules, okay? And there's also additional formatting that you can do or additional axis modifiers like public read only, espite, something like this, okay? Or public const espite where this is a constant, something like this, but we don't need to worry about that now. Anyways, let's run this and see what all the max values are. Also let's do min after this, okay? So here's all of our maxes. So our espite has a maximum of 127, our short has a maximum of 32767, here's our long, and here's our integer max, okay? So you can see that long is the biggest out of all of them. And for now let's move over here. You can see that basically these are pretty much twice as big, almost, okay? But not exactly. So here's all the maximums for the unsigned variables. These are assigned. And here's the floating points. So you can see that doubles very massive and decimals the smallest out of all of them. But yeah, so here's what we have. Okay, so let's talk about variables here. So signed variables and unsigned variables, they have the same amount of bits, not all of them, but like espite and byte, they have the same short and you sure they have the same amount of bits, right? Except they use one of them differently, okay? As I explained earlier. So espite and byte have eight bits, short and you short have 16 bits, you long and you long have 64, and into new ends have 32 bits, okay? So for floats, okay, so for float, float is a 32 bit floating point number, okay? Now doubles a 64 bit and decimals a 128 bit, all right? And boolean is one bit because it's just true or false. String and char, I don't think they really have a bit size. I'm not sure about that. And district we obviously can't tell because it's an object. It's the same thing with the string, right? It's an object, okay? So anyways, let's show what our minimums are. So as I'm doing this, I am determining the max value by doing its variable type dot max value, okay? And you can do the same thing for minimum value. And now let's see what the difference is. You see here, these are negatives, right? And now byte, these are all zero because again, these can only be positive numbers, okay? Unlike our unsigned variables here. No, our signed variables here. And same thing for our floating point variables, they can be negative as well. Anyways, if you enjoyed this video or learned something new, make sure you smash the like button. Subscribe to my channel if you're new and turn on this notification so you get notified for future live streams and videos. Comment whatever you'd like below. I will be sure to read and reply and make sure to heart them all. And if you want to support me, check out the Patreon link in the description. And check out my other videos in the top right corner. Anyways, thank you guys for watching. Peace.