Category: C#

Enums in C# with Example

Enums stands for enumerations.  It is basically a set of integral numbers.  Enums are value types.  Enums make your program more readable as well as more maintainable. I know since you are new to C#, the above lines do not make sense to you at all.  Lets understand enums with a very basic example.  Whenever

Region Keyword in C# with Example

Due to large amount of code, sometimes it becomes very difficult to know what a certain piece of code actually does.  However, we do have the option of using comments in code section, but there is much better way to simplify things.  We can use region keyword and can give that piece of code some

Protected Internal Access Modifier in C#

As you know, if you want to make your class reusable in other projects, then you can create a class library and add a reference to it in your projects.  However, which members are accessible and which are not, it all depends upon access modifiers.   Protected Internal is one of the access modifiers where

Internal Access Modifier in C#

Whenever you compile your dotnet project, an assembly is generated.  Depending upon your preference, it could be exe or dll file.  Usually, whenever we want to use an assembly in other projects, we generate a dll file.  Like any ohter dotnet assembly, it contains classes, structs, interfaces etc.  All of these containing types are accessible

Protected Access Modifier in C# with Example

In inheritance in C#, we know that all the public type members in base class are accessible through derived class.  Private type members in base class cannot be accessed through derived class.  Apart from Public and Private access modifiers, there is another access modifier called Protected access modifier.  By using Protected access modifier, you can