Object-Oriented Programming MCQs (Set-2)

What is polymorphism?

A Many variables of one type
B One interface, multiple implementations
C Only one class per program
D A method with no return

What is method overriding?

A Method name, new parameters
B A method calls itself
C Field hides class
D Subtype replaces inherited method behavior

What is method overloading?

A Subtype replaces base method
B Same name, different parameters
C A method without a body
D Creating several objects at once

When is overload selection often determined?

A Only after program exits
B At compile time
C By network response
D During garbage collection

What is dynamic dispatch?

A Choose overridden method at runtime
B Sort methods alphabetically
C Create object fields lazily
D Convert class to a file

What is a virtual method in languages like C++?

A Runtime overridable method
B Method with no parameters
C Method stored on disk
D Method available only in constructor

What is an abstract class?

A Class not directly instantiated
B Class with all public fields
C Class without inheritance
D Class with only static methods

What is an abstract method?

A Method always without value
B Private constructor
C Method declared without full implementation
D Method called only once

What is an interface?

A Object's private memory
B Contract of supported operations
C Class with required fields
D A runtime stack frame

What is multiple inheritance?

A Object has multiple fields
B Class derives from multiple bases
C Method has multiple parameters
D Program runs multiple threads

What is an overriding method's signature?

A Method name and parameter types
B Return value only
C Class name and fields
D Source file name

What is a covariant return type?

A Method returns two values
B A parameter becomes optional
C Return type changes per call
D Override returns subtype

What does super or base refer to?

A Parent class functionality
B Current object's fields only
C A global namespace
D A private helper function

What is a final or sealed class?

A Class that must be abstract
B Class with no methods
C Class that cannot be subclassed
D Class instantiated only once

What is a final method in some languages?

A Method with no implementation
B Static method only
C Constructor with no arguments
D Method that cannot be overridden

What does substitutability require?

A Base class must inherit subtype
B Every method must be static
C Objects must share addresses
D Subtype replaces base type

What is a type cast in OOP?

A Copy object into a file
B Rename a class
C View value as another type
D Change a method's visibility

What is an upcast?

A Convert base to subtype unchecked
B Convert object to string
C Subtype reference to base
D Change a private field

What is a downcast?

A Convert subtype to base type
B Convert base reference toward subtype
C Convert a class to interface
D Call a parent constructor

Why check a downcast at runtime?

A Base classes have no methods
B Fields always become null
C Object may not match subtype
D The compiler cannot read classes

What is interface segregation about?

A Small focused interfaces
B One large universal interface
C Interfaces with no methods
D Interfaces used only by constructors

What does dependency inversion favor?

A Depend on concrete details only
B Avoid all interfaces
C Depend on abstractions
D Make every dependency global

What is a mixin commonly used for?

A Share reusable behavior
B Store unique object state only
C Create a database table
D Sort subclass instances

What is duck typing?

A Compatibility only by class name
B Runtime type always hidden
C A method with no arguments
D Compatibility based on supported behavior

What is an object reference?

A Object's source code
B A class's method list
C A constructor return type
D Handle pointing to an object