Object-Oriented Programming (OOP) MCQs

Topic-wise practice questions for Programming (C++ / Java / Python). Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q11easy
If a class A has a protected member x, who can access it?
Q12medium
You want to prevent a method in a parent class from being overridden by any child class. What keyword should you use?
Q13easy
What is the Single Responsibility Principle (the S in SOLID)?
Q14easy
What is a Virtual Method Table (V-Table) used for?
Q15medium
Why will the following code fail to compile?

class Test {
    int x = 10;
    static void display() {
        print(x);
    }
}
Q16easy
What does the super (or base) keyword do inside a child class constructor?
Q17easy
In a language like Python, what is the purpose of the self (or this in Java) keyword?
Q18medium
Which OOP principle is primarily concerned with reducing "Tight Coupling" between different parts of a system?
Q19hard
You have a list of Employee objects. Some are Managers, some are Developers. You want to calculate the total salary by calling emp.getSalary() on every item in the list. This is possible because of:
Q20easy
What is a key difference between an Interface and an Abstract Class in modern Java (post-Java 8)?