Internal

If you set internal as an access specifier, this means that the entity is only accessible within the same assembly. All the classes in the assembly can access this class or member. When you build a project in .NET, it creates an assembly file, either dll or exe. There could be many assemblies in one solution, and internal members are only accessible by the classes on those particular assemblies.

Let's look at an example of this, as shown in the following code:

using System;
namespage AnimalProject {
static void Main(){
Dog dog = new Dog();
dog.GetName();
}

internal class Dog {
internal string GetName(){
return "doggy";
}
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.31.41