C# Operator Overloading

We have learned that the method can be overloaded in C#, in the same way, we can also overload the operator. We can perform the various operations with the same operator in C#. Operator overloading means performing different operations with the same operator. We can overload most of the built-in operators that are provided by … Read more

C# Method Overriding

Method overriding is done through inheritance, it allows us to define a method at a derived class with the same name present in a base class with the same signature and same return type then the method in a base class is said to be overridden. In method overriding, the base class method uses virtual … Read more

C# Method Overloading

A method is said to be overloaded if two or more methods having the same name but different parameters. The difference could be in a number of parameters or types of parameters so that compiler can tell the difference. The advantage of method overloading is that you don’t have to use different names for the … Read more

C# Polymorphism

Polymorphism means having many forms. The word “poly” means many and “morphs” means form. Polymorphism is one of the core principles of object-oriented programming which means it is the way of performing some task in many ways. With polymorphism, a class can have multiple implementations with the same name. There are two types of polymorphism … Read more

C# Properties

C# properties are the class members that provide a flexible way for the class to expose its private field. It provides a way to read, write, and perform some computation to the private fields of the class. These properties have special methods called accessors that are used to set, get, and compute on private fields … Read more

C# Namespace

Namespace in C# is used in a program to organize the code separately from each other. Classes are maintained with namespace to organize in a better way. With the use of namespace, we can keep one set of names different from another set of names. The vital importance of namespace is that it prevents the … Read more

C# Interface

An Interface is the same as a class, it is a blueprint of a class. Just like any other class, an interface can have methods, properties, events, and indexers as its members. But unlike a class, the method in it is an abstract method (only method signature, contain no body). Interface is used to achieve abstraction and multiple … Read more

C# Abstraction

Abstraction in object-oriented programming is a way to hide the details and only displaying the relevant information to the users. It is a technique through which we can separate the interface with the implementation details. Abstraction and encapsulation are the related feature in C#. Abstraction is used to hide the implementation detail while encapsulation is … Read more

C# Access Modifiers/Specifiers

Access modifiers or specifiers in C# define the accessibility of the member, class, or datatype in a program. These are the keyword that restricts unwanted manipulation of data in a program by other classes. There are five types of access specifiers in C#. Public Protected Internal Protected internal Private Let us go through each of … Read more

C# Encapsulation

Encapsulation is an important concept of Object-oriented programming. Encapsulation is the concept of wrapping up data(variable) under a single unit. It binds data members and member functions inside a class together. Encapsulation prevents accessing the implementation details, it makes sure that the ‘sensitive’ data are hidden from the user which leads to the important concept … Read more