Class 12 Computer Science Unit 5: OOP Concepts CDC Code: Com. 4281 4 Credit Hours | Board Weight: ~4 Marks

Unit 5: Object-Oriented Programming (OOP) Concepts

OOP vs POP paradigm comparison, core principles of Object-Oriented Programming: classes, objects, encapsulation, abstraction, inheritance, and polymorphism.

1. Procedure-Oriented Programming (POP) vs OOP
Feature Procedure-Oriented (POP) Object-Oriented (OOP)
Core Focus Focuses on functions, procedures, and algorithm logic. Focuses on data, state, and real-world objects.
Program Structure Divided into small functions/procedures. Divided into classes and objects.
Approach Top-down design approach. Bottom-up design approach.
Data Security Low security; global data moves freely between functions. High security; data is encapsulated and hidden from unauthorized access.
Code Reusability Limited code reusability. High reusability through inheritance.
Examples C, Pascal, FORTRAN, BASIC C++, Java, Python, C#, PHP
2. Fundamental Features & Principles of OOP
  1. Class: A user-defined data type and blueprint/template defining attributes (data members) and behaviors (member functions).
  2. Object: A basic runtime instance of a class that possesses state, behavior, and identity.
  3. Encapsulation: The bundling of data and the functions that manipulate that data into a single unit (class), hiding internal details from external misuse.
  4. Abstraction: Representing essential features of an object without including background implementation complexity.
  5. Inheritance: The mechanism by which a child (derived) class acquires properties and behaviors from a parent (base) class, promoting code reusability.
  6. Polymorphism: The ability of a message, function, or operator to take more than one form (e.g. Method Overloading, Method Overriding).