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
Q1easy
What will happen if a class does not define a constructor?
Q2easy
What is Method Overloading?
Q3easy
What is a Memory Leak in an OOP language like C++?
Q4medium
You have a class Shape with a method draw(). You have subclasses Circle and Square that provide their own versions of draw(). At runtime, the program decides which draw() to call based on the object type. This is:
Q5medium
Look at this Java/C# snippet. What is the output?

class Parent {
    void show() { print("Parent"); }
}
class Child extends Parent {
    void show() { print("Child"); }
}
Parent obj = new Child();
obj.show();
Q6easy
What is the difference between Aggregation and Composition?
Q7easy
What is a Copy Constructor?
Q8medium
Trace the value of count:

class Counter {
    static int count = 0;
    Counter() { count++; }
}
Counter c1 = new Counter();
Counter c2 = new Counter();
Counter c3 = new Counter();
print(Counter.count);
Q9easy
What is the meaning of the final keyword (or sealed in C#) when applied to a **Class**?
Q10easy
What is the purpose of a Constructor?