Skip to content
Sharp

Object-oriented programming · interview question

Why might an abstract class contain both abstract and concrete methods?

Multiple choiceHardchapter-5-curatedpremiumoopabstract-classes
Choose one answer
Answer and explanation

Correct answer

D. To provide default behavior while enforcing specific behaviors in subclasses.

Why

An abstract class can provide default implementations through concrete methods while requiring subclasses to implement specific behaviors via abstract methods. This allows flexibility and consistency.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →