Skip to content
Sharp

Software Architecture · interview question

A developer decides to use multiple inheritance in Java to create a highly abstracted e-commerce checkout system. What is a better approach?

Multiple choiceMediumchapter-13-curatedpremiumsoftware-architecturepattern-abuse
Choose one answer
Answer and explanation

Correct answer

B. Use interfaces with default methods

Why

Java supports interfaces with default methods to provide a way to achieve multiple inheritance-like behavior. This maintains flexibility and avoids the complexity and issues associated with multiple inheritance.

Test yourself on Software Architecture

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

Start free test
All Software Architecture questions →