Features of Object-Oriented Programming || Class and Objects || Bcis Notes

Features of Object-Oriented Programming || Class and Objects || Bcis Notes

Features of Object-Oriented Programming

The features of Object-Oriented Programming are given bellow:-

  1. Object
  2. Class
  3. Data Hiding and Encapsulation
  4. Dynamic Binding
  5. Message Passing
  6. Inheritance
  7. Polymorphism

 

a. Object:-

The object is a collection of the number of entities. Objects take up space in the memory. Objects are instances of classes. When a program is executed, the objects interact by sending messages to one another. Each object contains data and code to manipulate the data. Objects can interact without having know details of each other’s data or code.

b. Class:-

Class is a collection of objects of similar type. Objects are variables of the type of class. Once a class has been defined, we can create any number of objects belonging to that class.

  • Eg: grapes banana and orange are the members of class fruit.
    Example:
    Fruit orange;
    In the above statement, object mango is created which belong to the class fruit

c. Encapsulation

Combining data and functions into a single unit called class and the process is known as Encapsulation. Data encapsulation is an important feature of a class. A class contains both data and functions. Data is not accessible from the outside world and only those function which is present in the class can access the data. The insulation of the data from direct access by the program is called data hiding or information hiding. Hiding the complexity of the program is called Abstraction.

d. Dynamic Binding

Refers to linking of a function call with function definition is called binding and when it is taking place at run time called dynamic binding.

e. Message Passing.

The process by which one object can interact with another object is called message passing.

f.Inheritance

Inheritance is the process by which the object of one class acquires the properties or features of objects of another class. The concept of inheritance provides the idea of reusability means we can add additional features to an existing class without modifying it. This is possible by driving a new class from the existing one. The new class will have the combined features of both the classes.

g. Polymorphism

A greek term means the ability to take more than one form. An operation may exhibit different behaviours in different instances. The behaviour depends upon the types of data used in the operation.

  • Operator Overloading
  • Function Overloading

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*