If you are learning high level programming then it becomes very important that you have good knowledge of Object Oriented Programming Concept. Because to work in any high level programming language, one should have good knowledge of Object Oriented Programming Concept.
Today in this post I am going to give detailed information about Object Oriented Programming Concept to you people. According to the Object Oriented Programming Concept, the programming languages ​​that have the ability to implement Object Oriented Programming Concept in their programs are called Object Oriented Programming Languages. Like JAVA, C++, C#, Python etc.
Table of Content:
There are mainly six types of Object Oriented Programming Concept, which are as follows –
Contents
Class:
Object Oriented Programming Concept’s first concept is Class. If you want to understand the class, then ask yourself a question, “Have you ever seen a tree?” It must be strange to hear why I should ask this question for the definition of class and anyway you have already seen many trees.
But only by answering this question will you get to know the definition of class. So now tell me, which trees have you seen?
Your answer will probably be that I have seen many trees like mango, guava, jamun and many more trees. But from your answer it will be known that you have seen mango, guava trees etc. but have not seen any tree.
Now the thing to be understood here is that the tree is used only to define an object. For example, if an object has flowers, leaves, stems, branches, etc., then it will be called a tree, thus one defines a tree. Therefore, you can call a tree as the blueprint of information, which defines a tree. In the same way, “class can also be defined by a blueprint of information. Because anything will be class only if it expresses a group of some things, which have similar properties and religion.”
Note:
There is no physical existence of the class.
Definition: Class is the blueprint of information and does not have its physical existence.
Object:
Object Oriented Programming Concept’s second concept is Object. Anything that exists in this real world is called an object. Like motorcycles, cars, me and you etc.
Another good example of understanding object and class, you can also understand from the map of the house. Like in the map everything about the construction of the house is displayed but the map can never be someone’s house. But seeing that map, how many houses can be built according to the same map. Here you can think of map as a class and you can call a house built on the basis of map an object.
Definition: Any real word entity is known as an object.
Abstraction:
Object Oriented Programming Concept’s third concept is Abstraction. If the internal process of doing a task is hidden and the user is given an external user interface to perform the task, then this process is called abstraction.
For example, to turn on the fan, the user is given a switch (external user interface) with the help of which the user can turn the fan on or off and the entire process of getting the fan on and on is hidden behind the electric board and wall.
Definition: To hide the internal process of any task by providing an external user interface to the user is known as abstraction.
Encapsulation
Object Oriented Programming Concept’s forth concept is Encapsulation. To understand encapsulation, we can take an example of a car 🚗. For example, in a car there are parts like engine, brake, accelerator, clutch, etc., whose function is different. But without any part you cannot drive the car easily like if you remove the steering from your car then you cannot drive, or even if the accelerator is removed from the car, you will still be unable to drive a car. . Thus, you can say that a car is a car only if all its parts are in it.
Definition: Wrapping up data members and data methods into a single unit is known as encapsulation.
Inheritance
Object Oriented Programming Concept’s fifth concept is Inheritance.Today we all use smartphones. Along with talking to each other through these phones, you also use to take photos and listen to songs on the radio. That is, the smartphone has inherited the property of camera and radio, that is why along with talking through smart phone, we also use FM and camera📷.
When one class inherits the property of another class then this process is called inheritance.
Definition: Inheritance is a process where a class inherits the property of a class to another.
This Object Oriented Programming Concept’s means inheritance is of 5 types which are given below: –
Single Inheritance:
This is the most simple inheritance. In this type of inheritance there is one superclass and one sub class. The property of the super class is inherited by the sub class and an object of this class is created.
Multiple Inheritance:
In this type of inheritance, the property of two or more classes is inherited by one class and an object of the same class is created.
Multi-Level Inheritance:
In Multi-Level Inheritance there is a superclass whose property an intermediate class inherits and the subclass inherits the property of the intermediate class and the object of the sub class itself is created.
Hierarchical Inheritance:
In Hierarchical Inheritance there is a super class and its properties are inherited by many sub classes. Each subclass has an object.
Hybrid Inheritance:
Hybrid Inheritance is a combination of all the above types of inheritance. It has a super class and two intermediate classes and a sub class and an object of this sub class.
Polymorphism:
Polymorphism is made up of two words => poly (many) + morphism (Type) i.e. many types. Polymorphism is such a concept of programming in which we can express any one message in many ways. Like rectangle, circle and triangle, even after having different geometrical structures, their area can be derived, but the formula will be used differently to get the area. But all formula results will be area only. Here you must have understood that different formulas are used to calculate the area, but all the formulas are derived areas.
II think from this post you must have understood very well the concept of Object Oriented Programming according to Java. If you have any other problem then you can mail pr***********@gm***.com and ask your suggestion and query or you can also comment in below comment box.
You can also visit my youtube channel.
You can also read Introduction to Programming Language