Category Archives: C#

Command Line Arguments in C#


it will give error:

Exception in C#

Another example:

User Define Excepton where throws is use .NET Class




Base and Sealed class

base class field

//base class method

//calling base class constructor internally





Sealed variable not possible:






C# Generics

Generics Class:



Generics method:




C# Properties



Read Only:






Abstract class in C#



Polymorphism: Method Overloading and Method Overriding and Method Hiding

Method Overriding:

another good exmple:

this video is good for learning overriding:

Method Hiding:


Aggregation in OOP

I will discuss more later.

Inheritance in C#

Single Level Inheitance: Inheriting Fields

Single Level Inheritance: Inheriting Methods

Multilevel Inheritance:

Multiple Inheritance Through Interface:




Encapsulation in C#


C# Access Modifiers/Specifiers

C# Provides five types of access specifiers:

They are: Public, Private, Protected, Internal, Protected Internal

Public – It specifies that access is not restricted
Protected- It specifies that access is limited to the containing  class or in a derived class
Internal – It specifies that access is limited to the current assembly
Protected Internal – It specifes that access is limited to the current asembly or types from the derived class
Private – It specifies that acess is limited to the containing type

this video will surely help to understand:

Now lets see the example:


output: it will show error

but we can show the output through some tricks



Protected Internal:


eg 1:

eg 2:









C# Structs works almost like a Class !



How many constructor a class have in C# ?

Is it known as constructor overloading ?