Introduction
Object-Oriented Programming (OOP) is a way of designing and writing programs by organizing code around objects — self-contained units that bundle together data (called attributes or fields) and the operations on that data (called methods). Instead of thinking of a program as a long list of instructions acting on loose variables (the procedural style), OOP asks you to model the problem as a set of interacting objects, much like objects in the real world: a BankAccount has a balance and can deposit() or withdraw(); a Car has a speed and can accelerate().
For Bangladeshi government IT recruitment exams (BCS technical/IT cadre, Bangladesh Bank / Combined Bank IT-Officer, BCC, and various Programmer / Assistant Programmer posts), OOP is one of the most heavily tested areas of the "Programming Concepts" syllabus. Questions come in two flavours: (1) conceptual MCQs — "Which is NOT a feature of OOP?", "What is runtime polymorphism?", "Which keyword prevents inheritance?"; and (2) short definitions / code-reading. Mastering the four pillars and their exact terminology is therefore essential marks.
Learning objectives
After studying this lesson you should be able to:
- Define OOP and contrast it clearly with procedural programming.
- Explain class vs object, and the meaning of instance/instantiation.
- State and explain the four pillars — Encapsulation, Abstraction, Inheritance, Polymorphism — with intuition and examples.
- Distinguish compile-time (static) and runtime (dynamic) polymorphism, and overloading vs overriding.
- Understand access modifiers, constructors/destructors,
this, and the role ofstatic. - Distinguish types of inheritance and understand the diamond problem.
- Explain abstract classes vs interfaces, and composition vs inheritance.
- Answer typical exam MCQs quickly and avoid classic traps.