Which of the following is not a characteristic of Object-Oriented Programming?
Let’s go through the options and verify which ones are actual characteristics of Object-Oriented Programming (OOP):
(A) Encapsulation:
This is a core concept of OOP. It refers to wrapping data (variables) and methods (functions) together into a single unit called a class.
It restricts direct access to some of an object’s components, which is essential for data hiding and abstraction.
So, this is a valid OOP feature.
(B) Inheritance:
This is another fundamental feature of OOP. It allows one class (subclass) to inherit the properties and behaviors (methods) of another class (superclass).
This promotes code reuse and logical hierarchy.
So, this is also an OOP characteristic.
(C) Compilation:
This is a part of the software development process, not a specific feature of Object-Oriented Programming.
Compilation is the process by which code is converted from high-level programming language to machine code.
It is common to all programming paradigms (procedural, functional, OOP, etc.).
Hence, this is not a characteristic of OOP.
(D) Polymorphism:
This OOP concept allows methods or objects to behave differently based on the context.
For example, a function may have different behaviors based on the number or type of parameters passed.
This is achieved through method overloading and overriding.
Thus, this is also an OOP characteristic.
Five friends A, B, C, D, and E are sitting in a row facing north, but not necessarily in the same order:
B is to the immediate left of C
E is not at any of the ends
D is to the right of E but not next to C
A is at one of the ends
Who is sitting in the middle?