Object-Oriented Programming

There are some basic concepts of object oriented programming as follows: 

  • Object
  • Class
  • Data Abstraction
  • Data Encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic binding 

Object

In object-oriented programming (OOP), objects are the things you think about first in designing a program and they are also the units of code that are eventually derived from the process.

Class

In object-oriented programming , a class is a template definition of the method s andvariable s in a particular kind of object . Thus, an object is a specific instance of a class; it contains real values instead of variables.

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).

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.

Inheritance

Inheritance defines an is-a relationship between a superclass and its subclasses. This means that an object of a subclass can be used wherever an object of the superclass can be used. Class Inheritance in java mechanism is used to build new classes from existing classes. The inheritance relationship is transitive: if class x extends class y, then a class z, which extends class x, will also inherit from class y.

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.

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.