C# Beginners Tutorial - 142 - Internal Access Modifier

C# Beginners Tutorial - 142 - Internal Access Modifier

SUBTITLE'S INFO:

Language: English

Type: Robot

Number of phrases: 81

Number of words: 619

Number of symbols: 2577

DOWNLOAD SUBTITLES:

DOWNLOAD AUDIO AND VIDEO:

SUBTITLES:

Subtitles generated by robot
00:00
hey guys welcome to the 142nd c-sharp tutorial that I'm making for the new Boston and in this tutorial I'm gonna be showing you how to you the internal access modifier so when we first started learning about access modifiers I told you that there were a few that we weren't going to be able to learn that and the internal access modifier the last access modifier that we have to learn so the internal access modifier basically makes it so that we can only access something in the same project that we created it in so if I were to
00:32
make a class right here in terminal and I would only be able to access this class inside of this my tol project so if I were to create a new class even the different name space I would still be able to access this as a project so it's a class I let's call it my class all
01:03
right now before we can access the class we're going to tell the c-sharp compiler that in the clients name space because it's not in the same namespace as this class right here so there's no say client dot and then yep client shows right up Oh see so as you can see we can access this client class because it's in the same project even though it's in a different namespace alright but we won't be able to access it inside of this
01:33
client project up here so when you just save it in debug to save the changes that we've made then go back to our form right here and we won't be able to access the client class I can't do client yeah they won't let us you can also apply the internal access modifier to members and fields 12 and a member is basically a property event an indexer or a method so we could make this property right here internal so
02:04
we'd say intern strong name and now this name property using terminal and let me just make this class public all right so now we can access this name property inside of this method right here because it's in the same project as this property so we can do C dot name and yep we can access it but we won't be able to access it inside
02:34
of our client project so let me just save the debug here mmm alright go back to our form we can now access our client class because I made a public again but we won't be able to access that name property nope we came instantly and you can also apply this to field as well so if we wanted to make like a variable internally could so wanting like an internal integer alright
03:07
then we wouldn't be able to access it outside this project so 5 so now since this is in the same project as this field right here we'll be able to access it so I'm going to send out height yeah that's fine but we won't be able to do see that height in different project so let me just save in debug alright go back to our forms we can't do see that height it doesn't show up alright and a
03:40
way to tell if something is internal is in intellisense right there there should be like a little envelope icon on the far left side next to me in it and I'm a property it shows up towards the right but on I guess this field are here shows up on the left so that's pretty much it for this tutorial on the internal access modifier so see you guys

DOWNLOAD SUBTITLES: