Skip to main content

Features and characteristics of OOP

Short answer

Object-oriented programming models a program as objects that combine data and behavior. Key features are classes and objects, data abstraction, encapsulation for data hiding, inheritance for code reuse, polymorphism for multiple behaviors, dynamic binding, and message passing.

Explain the features (characteristics) of object oriented programming.

Object oriented programming (OOP) is a programming approach that organises a program as a collection of objects, where each object bundles data and the functions that work on that data. The main features are:

  1. Objects and classes - An object is a real-world entity with state (data) and behaviour (functions), such as a student or a bank account. A class is the blueprint from which objects are created; it is a user-defined data type.
  2. Data abstraction - Showing only the essential features to the user and hiding the implementation details. A user calls withdraw() without knowing how the balance is updated.
  3. Encapsulation - Wrapping data and functions into a single unit (the class). Data is kept private and is reached only through public member functions, which gives data hiding and protects data from accidental change.
  4. Inheritance - A new (derived) class acquires the properties and behaviour of an existing (base) class. It supports code reuse and a hierarchy of classes, e.g. Student derived from Person.
  5. Polymorphism - "One name, many forms". The same function name or operator behaves differently in different situations. It is of two kinds:
    • compile-time: function overloading and operator overloading
    • run-time: virtual functions
  6. Dynamic binding - The code executed for a function call is decided at run time, not at compile time. It goes with polymorphism and virtual functions.
  7. Message passing - Objects communicate by sending messages, i.e. calling the member functions of other objects: object.function(arguments).
   Person (base)
      ^
      |  inheritance
   Student (derived)

Example: In a banking program, Account is a class; ram and sita are its objects. Balance is private (encapsulation), and Saving and Current accounts inherit from Account.

These features make programs more secure, reusable, and easier to maintain.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Object Oriented Programming chapter 1 questions →