- Asked 7/10
- 2074 Chaitra · 3 marks
- 2074 Asoj · 6 marks
- 2073 Shrawan · 4 marks
- 2072 Chaitra · 5 marks
- 2070 Chaitra · 4 marks
- 2069 Chaitra · 3 marks
- 2068 Baisakh · 5 marks
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:
- 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.
- 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. - Encapsulation - Wrapping data and functions into a single unit (the class). Data is kept
privateand is reached only through public member functions, which gives data hiding and protects data from accidental change. - 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.
Studentderived fromPerson. - 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
- 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.
- 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)
Related questions
- Compare procedural and object oriented programming · Object Oriented Programming, chapter 1
- Advantages of OOP over procedural programming · Object Oriented Programming, chapter 1 · asked 5×
- How OOP differs from POP · Object Oriented Programming, chapter 1
- Simple program illustrating OOP concept · Object Oriented Programming, chapter 1
- Prime number program: procedural and OOP · Object Oriented Programming, chapter 1
- Transpose of matrix using OOP · Object Oriented Programming, chapter 1
- Characteristics and advantages of OOP · Software Engineering, chapter 2
- Object oriented system and core concepts · Object Oriented Analysis and Design, chapter 1
- Algorithmic vs object-oriented decomposition · Object Oriented Analysis and Design, chapter 1
- Is OOP enough in OOAD · Object Oriented Analysis and Design, chapter 1