Question Bank
1899 approved questions from the community
What is cohesion in OOP?
In hierarchical inheritance, one base class is inherited by multiple subclasses.
Polymorphism allows objects of derived classes to be treated as objects of their base class.
What is the difference between method overloading and method overriding?
What is coupling in OOP?
A constructor can have a return type.
What is a destructor or finalizer in OOP?
Destructors are primarily used for releasing resources before an object is destroyed.
Garbage collection in languages like Java and C# automatically manages memory reclamation.
What relationship does inheritance establish between classes?
What is late binding in the context of polymorphism?
High cohesion means that a class has multiple unrelated responsibilities.
What is the main difference between procedural and object-oriented programming?
An interface can have both method declarations and concrete method implementations in all programming languages.
What relationship does composition establish between classes?
What is common coupling?
In OOP, what does it mean when we say a class is 'instantiated'?
Loose coupling is generally preferred in software design.
What is a constructor in OOP?
What is aggregate storage in document stores like MongoDB?