What is an Object Oriented Programming (OOP) ? :-Today here i am going to discuss about a very popular topic which relates to CS/IT engineers life or we can say each and every programmer or application developer. For some of the student it is very frustrating but for some of them it is very interesting so, let’s have a short intro with this topic. OOP (object oriented programming ) follows some concepts, on that basis only one can say an programming language as object oriented and the concepts are :
- Data Abstraction and Encapsulation
Object oriented programming languages have vast scope in application development either it is on Android or any other languages. Day by day there are so many new programming languages are being invented which are based on OOP concepts. So, learning these types of programming languages makes an individual to work with new SDK’s platform. Now we are going to discuss each and every topic related to object oriented programming language step by step.
First of all we will discuss about object oriented programming and after that we will go further with its concepts…
Object Oriented Programming.
Object oriented programming was developed because limitations were discovered in earlier approaches of programming i.e procedural approach. Actually object oriented programming is an approach which provides a way of modularizing the programs in a short or partitioned area in which you can wrap your data and function both. We can say that object oriented programming is a method of implementation in which programs are organized as co-operative collection of objects, each of which represent and instances of their particular class. The major motivating factor in the invention of object oriented programming is to treat the data as a critical element in the program and doesn’t allow it to move freely around the system. There are some concepts on the basis of that we can say and programming language as an object oriented programming language and i have already mentioned the name in bullets form so let’s have a detail info about each of them.
They are the objects similar to our real world, or we can say objects are entities or run-time entities which exist in a program. These may represent a person, a place, a bank account, or any data that program has to handle. OOP allows decomposition of programming problem into a number of entities called objects and programming problems are analysed in terms of objects and nature of communication between them. Each and every class in object oriented programming have any number of objects.
An object is an instance of class . In other words, the entire set of data and code of an object can be made with the help of user defined data type i.e class. We can create as much as possible number of objects of any class. For example we can say, dog, cow, and cat are the members of ‘animal’ class.
Data Abstraction is that concept of OOP which refers to the representation of essential features of program without including the background details or any explanation of components included in the program. Suppose that if you are having a smartphone and someone is asking about the features of your smartphone then mostly you specifies the screen size, OS name, RAM etc which are the essential features to explain anyone without telling him/her the hardware components of the device board so similarly data abstraction also represents the essential data of the program.
All of you have seen the capsule (medicinal capsule) which wraps the mixture of medicinal components. Similarly the wrapping up of data and function into a single unit (i.e class) is knows as encapsulation. In this way the data is not accessible around the whole program only those function who are tied to that unit can access the data.
Polymorphism word is derived from the a ‘Greek’ term which means the ability to take more than one form. This is something similar to a particular word have several different meaning depending on the context. In OOP languages you can use single function name to perform different types of task .
This is very useful concept of object oriented programming, it helps a programmer to reuse the same code at different places. Inheritance is a process by which an object of a class can acquire the property of objects of another class. Or we can say when the property of base class is inherited to property of derived class then inheritance exists . Base class is the parent class and derived class is child class which gains the property of parent class.
So all these above concepts are the concepts of object oriented programming languages. Hope you will understand :p