Class and Constructor

Introduction of Class and Constructor

Class is the way to realize real time entity in oops. It is the user defined data type.

Syntax of Class

Continue...

Type of Constructor

There are two types of constructor and these are following:-

Static Constructor(also known as class constructor)

Continue...

Constructor Chaining

If you ask the question that can we call constructor from another constructor then I will say yes we can. Calling constructor from another constructor is known as constructor chaining. This can be done by the keyword this and base. Here we discuss on this keyword and will discuss base keyword in the article constructor with inheritance.

Continue...

Inheritance

Implementation of Inheritance

Inheritance is property of oops by which we access one class into another class without writing the whole code. The class that is inherited is called base class and the class that does the inheritance is called a derived class

Continue...

Access Specifier with Example

Access specifier defines the accessibility of class member. We can restrict and limit the accessibility of member of classes.

Continue...

Override and New in C#

At the time of overloading we generally use override with virtual. When we need to override the base class method into derived class than we use override keyword.

Continue...

Interface in Detail

Interface Implementation with Runtime Polymorphism

Interface in C# is basically a contract in which we declare only signature. The class which implemented this interface will define these signatures. Interface is also a way to achieve runtime polymorphism. We can add method, event, properties and indexers in interface

Continue...

Array in C Sharp

One Dimensional Array in C sharp

Array in C sharp is basically continues memory allocation of given type and size. We create array by using [].

Array Declaration

int[] data = new int[5];

Continue...

Searching in Array

To search any element in array we use Contains Function. This function is declared and defined in Array class. We have to pass the value in this method. If this value available in the given array then it will return true and if not then it will return false.

Continue...

Merging in Array

To search any element in array we use Contains Function. This function is declared and defined in Array class. We have to pass the value in this method. If this value available in the given array then it will return true and if not then it will return false.

Continue...

Jagged Array in C sharp

Jagged array is simply an array of arrays. As we define 2-d array in which each column for each rows are same. But in case of jagged array we can define different column for each rows.

Continue...

Operator Overloading

Implementation of Operator Overloading

Before understanding the operator overloading we need to understand why we use operator overloading. In the following example we have one class calculator which contains two variable x and y. and one web form where we create two variables in its cs file and add them.

Continue...

Generics and Collection

Implementation of IEnumerator and IEnumerable Interface and Yield Keyword

In simple term collection in C# is a way to store objects. We use System.Collection namespace to work with collection.

Continue...