FAQ 1 – What is Object Oriented Programming?

We deal with objects everyday. There are basically two kinds of objects namely, objects with life and without life. Animals and Human beings form living objects whereas Buildings and Furniture are objects without life. Each of these objects includes certain properties and you can also perform certain actions which ultimately describes their behavior. Object Oriented Programming mainly involves representing objects in a programming language and using them appropriately.

Before learning more about objects you should be aware about the concept of classes. A class represents group of objects of similar kind. Moreover, a class is considered as a template for creating multiple objects with similar features. For example, you can define Hard Disk, Motherboard, CD-ROM Drive and DVD-ROM Drive in a class called Computer. Here each of the computer spares are called as objects. Therefore, you can say that an object is an instance (copy) of a class. In the above case, Hard Disk and Motherboard are an instance of the class Computer and hence they are termed as objects.

All Object Oriented languages shares common set of features such as Encapsulation, Inheritance, and Polymorphism. An object oriented programming language code contains a class definition and its related objects. Hence, they are packaged into some sort of theme and this process is termed as Encapsulation. On the other hand, Inheritance is reusing of the features of one class in another class without defining them. So if you are building applications with large amount of code, you can apply this functionality so that you need not rewrite the whole code from scratch.

Polymorphism means defining different versions of the same code in various versions. The code snippet will be enclosed inside a method. For instance, Addition involves adding of 2 numbers, 3 numbers and so on. Here you are declaring one common situation in different ways. Since C# is an Object Oriented Programming language, it supports all the above features and hence you can apply them while developing C# applications.

Leave a Comment