 Alright, so before we continue this video, I just want you guys to be aware that I say derive a lot in this video. Now, I kinda got confused between declaring and deriving. Deriving is a completely different thing. That's where you, um, it's, it's, yeah, I don't wanna get into that because it's a little advanced. I'll do that eventually later on in this series. Basically whenever I say derive, replace that word with declare, okay? So, yeah, just a heads up. Hello guys, Crypto Grounds here. Welcome back to another C-Sharp Crash Course video. Today, we're gonna be doing access modifiers. Alright, if you enjoy this video, make sure you leave a like and drop a comment below and don't forget to subscribe and turn on notifications. Anyways, let's get on with it. So here we have our access modifiers. We have public, private, protected, internal, protected, internal and private protected. So I'm pretty sure the most familiar ones you've probably ever seen, if you've ever coded before, is public and private as I've used those in the past videos. So let me explain each of them because they're actually kinda go in depth. But public is pretty easy. This one can literally be accessed anywhere. It can be accessed even outside of your own project. So if you have a script outside of your project, it can be, and if you declare, or it can even be, yeah, it can be literally accessed anywhere. Private on the other hand is the most strict one, right? This one can only be accessed only in its own class. Even if you have a class A, for example, let's say class A is the one that has it. So if you have public, a temp equals new a, let's say this has a private variable. And we're right now, we're in class B. Let's say we're in class B, right? Basically, we cannot access any of its private variables, even if we make this right here. While if it was public, we could literally just do temp dot the variable name, variable name, we could access if it's public, we could access it if it was protected, even internal, right? However, it must be derived. So pretty much before I actually continue, we can literally use all of these in another class, as long as it's in our project. And we declare the method like this, we can do it just like that. But public, you could literally do a dot variable name to the issue with this is that if you have a class such as like a template, which you're using a class such as a such like like, if you're using as like a blueprint, like you have a constructor to define variables, and you don't want to change it, you want to make that private because you can easily change that outside of the class and you don't want that to happen. However, if you have like a script with other variables that you are wanting to change in another class, this is the way to go, right? Or you could just stick to objects and do this, and then doing temp dot variable. Yeah, I showed you before, but that's kind of how that works. So there's private. So protected as a little special, it's pretty much like private, except it can be used in other classes, I kind of explain that before. So we're going to write down the definition or the meaning for it. So can be accessed other classes, even if it's outside of your project, and other classes, if derive its class, derive its class. So basically, it's what I showed earlier, if you do public, sorry, public a temp equals new a, you're basically you're deriving a into a new class. Class B, I won't race at this time, you are deriving a into B. That makes sense. All right, so internal, internal is where you cannot use any of the variable or you cannot use that variable outside of the project. You can add this to classes as well. Well, these can honestly be used on class as well, you can literally do protected class, right, you can only, you know, you can do that, you can do internal class, where you can only derive like this inside your project, you cannot just create a class outside of the project, and try to derive it, you know, so internal can only be access in its original projects. Also for protected, you can also I want you to also add because it can be it can obviously be accessed in its own class, right? All of these can be accessed in its own class. Let me put a note right here, all can be accessed from its original class. And this goes the same thing for classes, if you and all of these can be defined in your in your can all can be accessed in your namespace or your project or your assembly, whatever you want to call it, right? Hopefully that makes sense. All right, just remember all these can be accessed inside of its original location. All right, these are kind of like, it's kind of like Google Drive, it's kind of giving someone a sharing permission to access your folder, you got view, edit, comment, kind of it's kind of like this, it's like giving variables or classes or permissions. All right. Protected internal. So this one's a bit, this one's nicer than get out. Okay, so protected internal is basically where you can access the class or variable as long as it's derived in the project or the other namespace where it's being accessed from. I'm just gonna write down where it can't be accessed. So can't be so protected internal can't be accessed. So can't be accessed in other namespaces. If if the origin isn't declared. So basically, it can only not be accessed. If you're using it in another project, and you are not declaring the class. Alright, so basically private protected the same thing as private work can't be accessed anywhere in your prod or outside of your project. But since private can only be accessed in its own class, private protected like that as well. However, if you derive the class inside your own project, then it can be used. So basically, it's a step up from private protected in a way. So can be accessed only if class is derived in other class in original namespace slash project. So hopefully that makes sense. So this was kind of confusing for classes. I completely understand. I mostly understand from variable a variable standpoint. But this was kind of like a bit mostly explanation for variables. So I guess I might as well call this access modifiers variables until I figure out classes. Alright, anyway, guys, that's a lot of information. So if you have any questions, let me down below. If I forgot anything, just let me know and I will be sure to fix that. Anyway, guys, thanks for watching. Don't forget to leave a like and subscribe and turn on notifications if you're new. Thanks for watching. Peace.