There are some basic concepts of object oriented programming as follows
1. Object
First understand what is Object? Object is a material thing that can be seen and touched. for example any device, gadget, body etc.
In programming term objects are important runtime entities in object oriented method. They may characterize a location, a bank account and a table of data or any entry that the program must handle.
Each object holds data and code to operate the data. Object can interact without having to identify the details of each other’s data or code. It is sufficient to identify the type of message received and the type of reply returned by the objects.
Here, student is represent as one object, It has it's data and methods, Data is nothing but information about the Object and methods are used to find or calculate some extra data of that Object.
2. Classes
A class is a set of objects with similar properties (attributes), common behavior (operations), and common link to other objects.
The complete set of data and code of an object can be made a user defined data type with the help of class.
The objects are variable of type class. A class is a collection of objects of similar type.
Classes are user defined data types and work like the build in type of the programming language.
Once the class has been defined, we can make any number of objects belonging to that class. Each object is related with the data of type class with which they are formed.
As we learned that, the classification of objects into various classes is based on its properties (States) and behavior (methods). Classes are used to distinguish are type of object from another. The important thing about the class is to identify the properties and procedures and applicability to its instances.
In above example, we will create an objects MH-01 1234 belonging to the class car. The objects develop their distinctiveness from the difference in their attribute value and relationships to other objects.
3. Data Abstraction
Data abstraction refers to the act of representing important description without including the background details or explanations.
Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, cost and functions operate on these attributes. They summarize all the important properties of the objects that are to be created.
Classes use the concepts of data abstraction and it is called as Abstract Data Type (ADT).
4. Data Encapsulation
Data Encapsulation means wrapping of data and functions into a single unit (i.e. class). It is most useful feature of class. The data is not easy to get to the outside world and only those functions which are enclosed in the class can access it.
These functions provide the boundary between Object’s data and program. This insulation of data from direct access by the program is called as Data hiding.
Capsule is the best real world example of Data Encapsulation.
5. Inheritance
Inheritance is the process by which objects of one class can get the properties of objects of another class, that mean one class of objects inherits the data and behaviors from another class.
Inheritance maintains the hierarchical classification in which a class inherits from its parents.
Inheritance provides the important feature of OOP that is re-usability. That means we can include additional characteristics to an existing class without modification. This is possible deriving a new class from existing one.
In other words, it is property of object-oriented systems that allow objects to be built from other objects. Inheritance allows openly taking help of the commonality of objects when constructing new classes.
Inheritance is a relationship between classes where one class is the parent class of another (derived) class. The derived class holds the properties and behavior of base class in addition to the properties and behavior of derived class.
In above example, the Santro is a part of the class Hyundai which is again part of the class car and car is the part of the class vehicle. That means vehicle class is the parent class.
6. Polymorphism
Poly means "many" and morph means "form". Polymorphism means the ability to take more than one form.
Polymorphism plays a main role in allocate objects having different internal structures to share the same external interface.
This means that a general class of operations may be accessed in the same manner even though specific activities associated with each operation may differ.
Polymorphism is broadly used in implementing inheritance. It means objects that can take on or assume many different forms.
Polymorphism means that the same operations may behave differently on different classes.
It defines polymorphism as the relationship of objects many different classes by some common super class.
Polymorphism allows us to write generic, reusable code more easily, because we can specify general instructions and delegate the implementation detail to the objects involved.
7. Dynamic Binding
Binding refers to the linking of a procedure call to the code to be executed in response to the call.
Dynamic binding means that the code related with a given procedure call is not known until the time of the call at run time.
Dynamic binding is associated polymorphism and inheritance.