Object Oriented Concept in C#

Class & Objects in C#

Class   A class is the most powerful data type in C#. Like structures, a class defines the data and behavior of the data type. It is nothing but a variable of type Object. Programmers can create objects that is called instance of a class. Unlike structures, classes support inheritance, a fundamental part of object-oriented …

Class & Objects in C# Read More »

Interfaces in C#

C# language does not support multiple inheritance. To solve this problem, Microsoft introduced interfaces into C#. They are regarded as an alternative to multiple inheritance. All interfaces should be declared with the keyword Interface.   You can implement any number of interfaces in a single derived class. A method declared inside the interface doesn’t contain …

Interfaces in C# Read More »

Abstract Class in C#

The abstract class is a special type of class which contains at least one abstract method. It should be declared with the keyword abstract. Every abstract class consists of one or more abstract methods. These methods will only have the method definitions i.e. abstract class will not have any method body, such as the instance …

Abstract Class in C# Read More »

Sealed Class in C#

Classes declared with the sealed keyword cannot be extended. That means, when you declare a base class with this keyword, you cannot use it in a derived class. In other words the class cannot be extended. This keyword is similar to that of final keyword in Java.   The given example SealedClass.cs is a modified …

Sealed Class in C# Read More »

Scroll to Top